diff --git a/x-pack/legacy/plugins/uptime/common/graphql/introspection.json b/x-pack/legacy/plugins/uptime/common/graphql/introspection.json deleted file mode 100644 index 18f26552d3153..0000000000000 --- a/x-pack/legacy/plugins/uptime/common/graphql/introspection.json +++ /dev/null @@ -1,4032 +0,0 @@ -{ - "__schema": { - "queryType": { "name": "Query" }, - "mutationType": null, - "subscriptionType": null, - "types": [ - { - "kind": "OBJECT", - "name": "Query", - "description": "", - "fields": [ - { - "name": "allPings", - "description": "Get a list of all recorded pings for all monitors", - "args": [ - { - "name": "sort", - "description": "Optional: the direction to sort by. Accepts 'asc' and 'desc'. Defaults to 'desc'.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "size", - "description": "Optional: the number of results to return.", - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "defaultValue": null - }, - { - "name": "monitorId", - "description": "Optional: the monitor ID filter.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "status", - "description": "Optional: the check status to filter by.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "dateRangeStart", - "description": "The lower limit of the date range.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "The upper limit of the date range.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "location", - "description": "Optional: agent location to filter by.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "PingResults", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getMonitors", - "description": "", - "args": [ - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "filters", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "statusFilter", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { "kind": "OBJECT", "name": "LatestMonitorsResult", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getSnapshot", - "description": "", - "args": [ - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "filters", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "statusFilter", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { "kind": "OBJECT", "name": "Snapshot", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getMonitorChartsData", - "description": "", - "args": [ - { - "name": "monitorId", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "location", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { "kind": "OBJECT", "name": "MonitorChart", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getLatestMonitors", - "description": "Fetch the most recent event data for a monitor ID, date range, location.", - "args": [ - { - "name": "dateRangeStart", - "description": "The lower limit of the date range.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "The upper limit of the date range.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "monitorId", - "description": "Optional: a specific monitor ID filter.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "location", - "description": "Optional: a specific instance location filter.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "Ping", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getFilterBar", - "description": "", - "args": [ - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - } - ], - "type": { "kind": "OBJECT", "name": "FilterBar", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getMonitorStates", - "description": "Fetches the current state of Uptime monitors for the given parameters.", - "args": [ - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "pagination", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "filters", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "statusFilter", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { "kind": "OBJECT", "name": "MonitorSummaryResult", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getStatesIndexStatus", - "description": "Fetches details about the uptime index.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "StatesIndexStatus", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "String", - "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PingResults", - "description": "", - "fields": [ - { - "name": "total", - "description": "Total number of matching pings", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": "Unique list of all locations the query matched", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pings", - "description": "List of pings ", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "Ping", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "UnsignedInteger", - "description": "", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Ping", - "description": "A request sent from a monitor to a host", - "fields": [ - { - "name": "id", - "description": "unique ID for this ping", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timestamp", - "description": "The timestamp of the ping's creation", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "beat", - "description": "The agent that recorded the ping", - "args": [], - "type": { "kind": "OBJECT", "name": "Beat", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "container", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Container", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "docker", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Docker", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ecs", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "ECS", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "error", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Error", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "host", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Host", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "http", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "HTTP", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "icmp", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "ICMP", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "kubernetes", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Kubernetes", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "meta", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Meta", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "monitor", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Monitor", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "observer", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Observer", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "resolve", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Resolve", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "socks5", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Socks5", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "summary", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Summary", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tags", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tcp", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "TCP", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tls", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "PingTLS", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "URL", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Beat", - "description": "An agent for recording a beat", - "fields": [ - { - "name": "hostname", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timezone", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Container", - "description": "", - "fields": [ - { - "name": "id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "image", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "ContainerImage", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "runtime", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ContainerImage", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tag", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Docker", - "description": "", - "fields": [ - { - "name": "id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "image", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ECS", - "description": "", - "fields": [ - { - "name": "version", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Error", - "description": "", - "fields": [ - { - "name": "code", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "message", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Host", - "description": "", - "fields": [ - { - "name": "architecture", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hostname", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ip", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mac", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "os", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "OS", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OS", - "description": "", - "fields": [ - { - "name": "family", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "kernel", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "platform", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "version", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "build", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HTTP", - "description": "", - "fields": [ - { - "name": "response", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "HTTPResponse", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "HttpRTT", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HTTPResponse", - "description": "", - "fields": [ - { - "name": "status_code", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "body", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "HTTPBody", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HTTPBody", - "description": "", - "fields": [ - { - "name": "bytes", - "description": "Size of HTTP response body in bytes", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hash", - "description": "Hash of the HTTP response body", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "content", - "description": "Response body of the HTTP Response. May be truncated based on client settings.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "content_bytes", - "description": "Byte length of the content string, taking into account multibyte chars.", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HttpRTT", - "description": "", - "fields": [ - { - "name": "content", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "response_header", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "validate", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "validate_body", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "write_request", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Duration", - "description": "The monitor's status for a ping", - "fields": [ - { - "name": "us", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ICMP", - "description": "", - "fields": [ - { - "name": "requests", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Kubernetes", - "description": "", - "fields": [ - { - "name": "container", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "KubernetesContainer", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "namespace", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "node", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "KubernetesNode", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pod", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "KubernetesPod", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "KubernetesContainer", - "description": "", - "fields": [ - { - "name": "image", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "KubernetesNode", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "KubernetesPod", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "uid", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Meta", - "description": "", - "fields": [ - { - "name": "cloud", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "MetaCloud", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MetaCloud", - "description": "", - "fields": [ - { - "name": "availability_zone", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "instance_id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "instance_name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "machine_type", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "project_id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "provider", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "region", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Monitor", - "description": "", - "fields": [ - { - "name": "duration", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "host", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The id of the monitor", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ip", - "description": "The IP pinged by the monitor", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the protocol being monitored", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "scheme", - "description": "The protocol scheme of the monitored host", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The status of the monitored host", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "The type of host being monitored", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "check_group", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Observer", - "description": "Metadata added by a proccessor, which is specified in its configuration.", - "fields": [ - { - "name": "geo", - "description": "Geolocation data for the agent.", - "args": [], - "type": { "kind": "OBJECT", "name": "Geo", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Geo", - "description": "Geolocation data added via processors to enrich events.", - "fields": [ - { - "name": "city_name", - "description": "Name of the city in which the agent is running.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "continent_name", - "description": "The name of the continent on which the agent is running.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "country_iso_code", - "description": "ISO designation for the agent's country.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "country_name", - "description": "The name of the agent's country.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "location", - "description": "The lat/long of the agent.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "A name for the host's location, e.g. 'us-east-1' or 'LAX'.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "region_iso_code", - "description": "ISO designation of the agent's region.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "region_name", - "description": "Name of the region hosting the agent.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Resolve", - "description": "", - "fields": [ - { - "name": "host", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ip", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Socks5", - "description": "", - "fields": [ - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "RTT", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RTT", - "description": "", - "fields": [ - { - "name": "connect", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "handshake", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "validate", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Summary", - "description": "", - "fields": [ - { - "name": "up", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "down", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "geo", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "CheckGeo", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckGeo", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "location", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Location", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Location", - "description": "", - "fields": [ - { - "name": "lat", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lon", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Float", - "description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TCP", - "description": "", - "fields": [ - { - "name": "port", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "RTT", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PingTLS", - "description": "Contains monitor transmission encryption information.", - "fields": [ - { - "name": "certificate_not_valid_after", - "description": "The date and time after which the certificate is invalid.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "certificate_not_valid_before", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "certificates", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "RTT", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "URL", - "description": "", - "fields": [ - { - "name": "full", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "scheme", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "domain", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "port", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "path", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "query", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "DocCount", - "description": "", - "fields": [ - { - "name": "count", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "LatestMonitorsResult", - "description": "", - "fields": [ - { - "name": "monitors", - "description": "", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "LatestMonitor", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "LatestMonitor", - "description": "Represents the latest recorded information about a monitor.", - "fields": [ - { - "name": "id", - "description": "The ID of the monitor represented by this data.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "MonitorKey", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ping", - "description": "Information from the latest document.", - "args": [], - "type": { "kind": "OBJECT", "name": "Ping", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "upSeries", - "description": "Buckets of recent up count status data.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "MonitorSeriesPoint", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "downSeries", - "description": "Buckets of recent down count status data.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "MonitorSeriesPoint", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorKey", - "description": "", - "fields": [ - { - "name": "key", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorSeriesPoint", - "description": "", - "fields": [ - { - "name": "x", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "y", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Snapshot", - "description": "", - "fields": [ - { - "name": "counts", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "SnapshotCount", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SnapshotCount", - "description": "", - "fields": [ - { - "name": "up", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "down", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorChart", - "description": "The data used to populate the monitor charts.", - "fields": [ - { - "name": "locationDurationLines", - "description": "The average values for the monitor duration.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "LocationDurationLine", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The counts of up/down checks for the monitor.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "StatusData", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "statusMaxCount", - "description": "The maximum status doc count in this chart.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "durationMaxValue", - "description": "The maximum duration value in this chart.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "LocationDurationLine", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "line", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "MonitorDurationAveragePoint", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorDurationAveragePoint", - "description": "Represents the average monitor duration ms at a point in time.", - "fields": [ - { - "name": "x", - "description": "The timeseries value for this point.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "y", - "description": "The average duration ms for the monitor.", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StatusData", - "description": "Represents a bucket of monitor status information.", - "fields": [ - { - "name": "x", - "description": "The timeseries point for this status data.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "up", - "description": "The value of up counts for this point.", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "down", - "description": "The value for down counts for this point.", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "The total down counts for this point.", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FilterBar", - "description": "The data used to enrich the filter bar.", - "fields": [ - { - "name": "ids", - "description": "A series of monitor IDs in the heartbeat indices.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": "The location values users have configured for the agents.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ports", - "description": "The ports of the monitored endpoints.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "schemes", - "description": "The schemes used by the monitors.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "statuses", - "description": "The possible status values contained in the indices.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "urls", - "description": "The list of URLs", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorSummaryResult", - "description": "The primary object returned for monitor states.", - "fields": [ - { - "name": "prevPagePagination", - "description": "Used to go to the next page of results", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nextPagePagination", - "description": "Used to go to the previous page of results", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "summaries", - "description": "The objects representing the state of a series of heartbeat monitors.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "MonitorSummary", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalSummaryCount", - "description": "The number of summaries.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "DocCount", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorSummary", - "description": "Represents the current state and associated data for an Uptime monitor.", - "fields": [ - { - "name": "monitor_id", - "description": "The ID assigned by the config or generated by the user.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "state", - "description": "The state of the monitor and its associated details.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "State", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "histogram", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "SummaryHistogram", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "State", - "description": "Unifies the subsequent data for an uptime monitor.", - "fields": [ - { - "name": "agent", - "description": "The agent processing the monitor.", - "args": [], - "type": { "kind": "OBJECT", "name": "Agent", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checks", - "description": "There is a check object for each instance of the monitoring agent.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "Check", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "geo", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateGeo", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "observer", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateObserver", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "monitor", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "MonitorState", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "summary", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "Summary", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timestamp", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tls", - "description": "Transport encryption information.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { "kind": "OBJECT", "name": "StateTLS", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateUrl", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Agent", - "description": "", - "fields": [ - { - "name": "id", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Check", - "description": "", - "fields": [ - { - "name": "agent", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Agent", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "container", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateContainer", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "kubernetes", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateKubernetes", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "monitor", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "CheckMonitor", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "observer", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "CheckObserver", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timestamp", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateContainer", - "description": "", - "fields": [ - { - "name": "id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateKubernetes", - "description": "", - "fields": [ - { - "name": "pod", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StatePod", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StatePod", - "description": "", - "fields": [ - { - "name": "uid", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckMonitor", - "description": "", - "fields": [ - { - "name": "ip", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckObserver", - "description": "", - "fields": [ - { - "name": "geo", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "CheckGeo", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateGeo", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "location", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Location", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateObserver", - "description": "", - "fields": [ - { - "name": "geo", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateGeo", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorState", - "description": "", - "fields": [ - { - "name": "status", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateTLS", - "description": "Contains monitor transmission encryption information.", - "fields": [ - { - "name": "certificate_not_valid_after", - "description": "The date and time after which the certificate is invalid.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "certificate_not_valid_before", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "certificates", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "RTT", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateUrl", - "description": "", - "fields": [ - { - "name": "domain", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "full", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "path", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "port", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "scheme", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SummaryHistogram", - "description": "Monitor status data over time.", - "fields": [ - { - "name": "count", - "description": "The number of documents used to assemble the histogram.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "points", - "description": "The individual histogram data points.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "SummaryHistogramPoint", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SummaryHistogramPoint", - "description": "Represents a monitor's statuses for a period of time.", - "fields": [ - { - "name": "timestamp", - "description": "The time at which these data were collected.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "up", - "description": "The number of _up_ documents.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "down", - "description": "The number of _down_ documents.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StatesIndexStatus", - "description": "Represents the current status of the uptime index.", - "fields": [ - { - "name": "indexExists", - "description": "Flag denoting whether the index exists.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "docCount", - "description": "The number of documents in the index.", - "args": [], - "type": { "kind": "OBJECT", "name": "DocCount", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "description": "The `Boolean` scalar type represents `true` or `false`.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "fields": [ - { - "name": "types", - "description": "A list of all types supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "queryType", - "description": "The type that query operations will be rooted at.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mutationType", - "description": "If this server supports mutation, the type that mutation operations will be rooted at.", - "args": [], - "type": { "kind": "OBJECT", "name": "__Type", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": "If this server support subscription, the type that subscription operations will be rooted at.", - "args": [], - "type": { "kind": "OBJECT", "name": "__Type", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "directives", - "description": "A list of all directives supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Directive", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "fields": [ - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "ENUM", "name": "__TypeKind", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { "kind": "SCALAR", "name": "Boolean", "ofType": null }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Field", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { "kind": "SCALAR", "name": "Boolean", "ofType": null }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__EnumValue", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "inputFields", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__InputValue", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { "kind": "OBJECT", "name": "__Type", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "description": "An enum describing what kind of type a given `__Type` is.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SCALAR", - "description": "Indicates this type is a scalar.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Indicates this type is a union. `possibleTypes` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Indicates this type is an enum. `enumValues` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Indicates this type is an input object. `inputFields` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": "Indicates this type is a list. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": "Indicates this type is a non-null. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__InputValue", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValue", - "description": "A GraphQL-formatted string representing the default value for this input value.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "ENUM", "name": "__DirectiveLocation", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__InputValue", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "onOperation", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - }, - { - "name": "onFragment", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - }, - { - "name": "onField", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "QUERY", - "description": "Location adjacent to a query operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": "Location adjacent to a mutation operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": "Location adjacent to a subscription operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": "Location adjacent to a field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": "Location adjacent to a fragment definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": "Location adjacent to a fragment spread.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": "Location adjacent to an inline fragment.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEMA", - "description": "Location adjacent to a schema definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": "Location adjacent to a scalar definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Location adjacent to an object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": "Location adjacent to a field definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARGUMENT_DEFINITION", - "description": "Location adjacent to an argument definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Location adjacent to an interface definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Location adjacent to a union definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Location adjacent to an enum definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": "Location adjacent to an enum value definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Location adjacent to an input object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_FIELD_DEFINITION", - "description": "Location adjacent to an input object field definition.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorDurationAreaPoint", - "description": "Represents a monitor's duration performance in microseconds at a point in time.", - "fields": [ - { - "name": "x", - "description": "The timeseries value for this point in time.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "yMin", - "description": "The min duration value in microseconds at this time.", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "yMax", - "description": "The max duration value in microseconds at this point.", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorSummaryUrl", - "description": "", - "fields": [ - { - "name": "domain", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fragment", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "full", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "original", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "password", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "path", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "port", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "query", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "scheme", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "username", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "CursorDirection", - "description": "", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { "name": "AFTER", "description": "", "isDeprecated": false, "deprecationReason": null }, - { "name": "BEFORE", "description": "", "isDeprecated": false, "deprecationReason": null } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "SortOrder", - "description": "", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { "name": "ASC", "description": "", "isDeprecated": false, "deprecationReason": null }, - { "name": "DESC", "description": "", "isDeprecated": false, "deprecationReason": null } - ], - "possibleTypes": null - } - ], - "directives": [ - { - "name": "skip", - "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", - "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], - "args": [ - { - "name": "if", - "description": "Skipped when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "defaultValue": null - } - ] - }, - { - "name": "include", - "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", - "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], - "args": [ - { - "name": "if", - "description": "Included when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "defaultValue": null - } - ] - }, - { - "name": "deprecated", - "description": "Marks an element of a GraphQL schema as no longer supported.", - "locations": ["FIELD_DEFINITION", "ENUM_VALUE"], - "args": [ - { - "name": "reason", - "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": "\"No longer supported\"" - } - ] - } - ] - } -} diff --git a/x-pack/legacy/plugins/uptime/common/graphql/types.ts b/x-pack/legacy/plugins/uptime/common/graphql/types.ts index 643c419be0411..a33a69c229873 100644 --- a/x-pack/legacy/plugins/uptime/common/graphql/types.ts +++ b/x-pack/legacy/plugins/uptime/common/graphql/types.ts @@ -8,6 +8,7 @@ // Scalars // ==================================================== + export type UnsignedInteger = any; // ==================================================== @@ -18,14 +19,6 @@ export interface Query { /** Get a list of all recorded pings for all monitors */ allPings: PingResults; - getMonitors?: LatestMonitorsResult | null; - - getSnapshot?: Snapshot | null; - - getMonitorChartsData?: MonitorChart | null; - /** Fetch the most recent event data for a monitor ID, date range, location. */ - getLatestMonitors: Ping[]; - /** Fetches the current state of Uptime monitors for the given parameters. */ getMonitorStates?: MonitorSummaryResult | null; /** Fetches details about the uptime index. */ @@ -376,32 +369,6 @@ export interface DocCount { count: UnsignedInteger; } -export interface LatestMonitorsResult { - monitors?: LatestMonitor[] | null; -} -/** Represents the latest recorded information about a monitor. */ -export interface LatestMonitor { - /** The ID of the monitor represented by this data. */ - id: MonitorKey; - /** Information from the latest document. */ - ping?: Ping | null; - /** Buckets of recent up count status data. */ - upSeries?: MonitorSeriesPoint[] | null; - /** Buckets of recent down count status data. */ - downSeries?: MonitorSeriesPoint[] | null; -} - -export interface MonitorKey { - key: string; - - url?: string | null; -} - -export interface MonitorSeriesPoint { - x?: UnsignedInteger | null; - - y?: number | null; -} export interface Snapshot { counts: SnapshotCount; @@ -416,42 +383,6 @@ export interface SnapshotCount { } -/** The data used to populate the monitor charts. */ -export interface MonitorChart { - /** The average values for the monitor duration. */ - locationDurationLines: LocationDurationLine[]; - /** The counts of up/down checks for the monitor. */ - status: StatusData[]; - /** The maximum status doc count in this chart. */ - statusMaxCount: number; - /** The maximum duration value in this chart. */ - durationMaxValue: number; -} - -export interface LocationDurationLine { - name: string; - - line: MonitorDurationAveragePoint[]; -} -/** Represents the average monitor duration ms at a point in time. */ -export interface MonitorDurationAveragePoint { - /** The timeseries value for this point. */ - x: UnsignedInteger; - /** The average duration ms for the monitor. */ - y?: number | null; -} -/** Represents a bucket of monitor status information. */ -export interface StatusData { - /** The timeseries point for this status data. */ - x: UnsignedInteger; - /** The value of up counts for this point. */ - up?: number | null; - /** The value for down counts for this point. */ - down?: number | null; - /** The total down counts for this point. */ - total?: number | null; -} - /** The primary object returned for monitor states. */ export interface MonitorSummaryResult { /** Used to go to the next page of results */ @@ -619,16 +550,6 @@ export interface AllPingsQueryArgs { location?: string | null; } -export interface GetMonitorChartsDataQueryArgs { - monitorId: string; - - dateRangeStart: string; - - dateRangeEnd: string; - - location?: string | null; -} - export interface GetMonitorStatesQueryArgs { dateRangeStart: string; diff --git a/x-pack/legacy/plugins/uptime/common/types/index.ts b/x-pack/legacy/plugins/uptime/common/types/index.ts index 34bfbc540672f..2c39f2a3b7314 100644 --- a/x-pack/legacy/plugins/uptime/common/types/index.ts +++ b/x-pack/legacy/plugins/uptime/common/types/index.ts @@ -4,4 +4,42 @@ * you may not use this file except in compliance with the Elastic License. */ +/** Represents a bucket of monitor status information. */ +export interface StatusData { + /** The timeseries point for this status data. */ + x: number; + /** The value of up counts for this point. */ + up?: number | null; + /** The value for down counts for this point. */ + down?: number | null; + /** The total down counts for this point. */ + total?: number | null; +} + +/** Represents the average monitor duration ms at a point in time. */ +export interface MonitorDurationAveragePoint { + /** The timeseries value for this point. */ + x: number; + /** The average duration ms for the monitor. */ + y?: number | null; +} + +export interface LocationDurationLine { + name: string; + + line: MonitorDurationAveragePoint[]; +} + +/** The data used to populate the monitor charts. */ +export interface MonitorDurationResult { + /** The average values for the monitor duration. */ + locationDurationLines: LocationDurationLine[]; + /** The counts of up/down checks for the monitor. */ + status: StatusData[]; + /** The maximum status doc count in this chart. */ + statusMaxCount: number; + /** The maximum duration value in this chart. */ + durationMaxValue: number; +} + export * from './ping/histogram'; diff --git a/x-pack/legacy/plugins/uptime/common/types/ping/histogram.ts b/x-pack/legacy/plugins/uptime/common/types/ping/histogram.ts index 7ac8d1f7b0151..a4e03a2b762c8 100644 --- a/x-pack/legacy/plugins/uptime/common/types/ping/histogram.ts +++ b/x-pack/legacy/plugins/uptime/common/types/ping/histogram.ts @@ -4,18 +4,16 @@ * you may not use this file except in compliance with the Elastic License. */ -export type UnsignedInteger = any; - export interface HistogramDataPoint { upCount?: number | null; downCount?: number | null; - x?: UnsignedInteger | null; + x?: number | null; - x0?: UnsignedInteger | null; + x0?: number | null; - y?: UnsignedInteger | null; + y?: number | null; } export interface GetPingHistogramParams { diff --git a/x-pack/legacy/plugins/uptime/public/components/connected/charts/monitor_duration.tsx b/x-pack/legacy/plugins/uptime/public/components/connected/charts/monitor_duration.tsx new file mode 100644 index 0000000000000..8d2b8d2cd8e0d --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/components/connected/charts/monitor_duration.tsx @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React, { useContext, useEffect } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { useUrlParams } from '../../../hooks'; +import { getMonitorDurationAction } from '../../../state/actions'; +import { DurationChartComponent } from '../../functional/charts'; +import { selectDurationLines } from '../../../state/selectors'; +import { UptimeRefreshContext } from '../../../contexts'; + +interface Props { + monitorId: string; +} + +export const DurationChart: React.FC = ({ monitorId }: Props) => { + const [getUrlParams] = useUrlParams(); + const { dateRangeStart, dateRangeEnd } = getUrlParams(); + + const { monitor_duration, loading } = useSelector(selectDurationLines); + + const dispatch = useDispatch(); + + const { lastRefresh } = useContext(UptimeRefreshContext); + + useEffect(() => { + dispatch( + getMonitorDurationAction({ monitorId, dateStart: dateRangeStart, dateEnd: dateRangeEnd }) + ); + }, [dateRangeStart, dateRangeEnd, dispatch, lastRefresh, monitorId]); + + return ( + + ); +}; diff --git a/x-pack/legacy/plugins/uptime/public/components/connected/index.ts b/x-pack/legacy/plugins/uptime/public/components/connected/index.ts index 585f0bf7f25f5..2e30e5c3cb24f 100644 --- a/x-pack/legacy/plugins/uptime/public/components/connected/index.ts +++ b/x-pack/legacy/plugins/uptime/public/components/connected/index.ts @@ -12,3 +12,4 @@ export { MonitorStatusDetails } from './monitor/status_details_container'; export { MonitorStatusBar } from './monitor/status_bar_container'; export { MonitorListDrawer } from './monitor/list_drawer_container'; export { MonitorListActionsPopover } from './monitor/drawer_popover_container'; +export { DurationChart } from './charts/monitor_duration'; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap index 9853ed5cadfc9..dff5def46cbe0 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap +++ b/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap @@ -51,140 +51,8 @@ exports[`MonitorCharts component renders the component without errors 1`] = ` } } > - `; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/monitor_charts.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/monitor_charts.test.tsx index f8e885147b992..3355eb63fd689 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/monitor_charts.test.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/monitor_charts.test.tsx @@ -6,8 +6,7 @@ import React from 'react'; import DateMath from '@elastic/datemath'; -import { MonitorChartsComponent } from '../monitor_charts'; -import { MonitorChart } from '../../../../common/graphql/types'; +import { MonitorCharts } from '../monitor_charts'; import { shallowWithRouter } from '../../../lib'; describe('MonitorCharts component', () => { @@ -23,56 +22,8 @@ describe('MonitorCharts component', () => { jest.clearAllMocks(); }); - const chartResponse: { monitorChartsData: MonitorChart } = { - monitorChartsData: { - locationDurationLines: [ - { - name: 'somewhere', - line: [ - { x: 1548697620000, y: 743928.2027027027 }, - { x: 1548697920000, y: 766840.0133333333 }, - { x: 1548698220000, y: 786970.8266666667 }, - { x: 1548698520000, y: 781064.7808219178 }, - { x: 1548698820000, y: 741563.04 }, - { x: 1548699120000, y: 759354.6756756756 }, - { x: 1548699420000, y: 737533.3866666667 }, - { x: 1548699720000, y: 728669.0266666666 }, - { x: 1548700020000, y: 719951.64 }, - { x: 1548700320000, y: 769181.7866666666 }, - { x: 1548700620000, y: 740805.2666666667 }, - ], - }, - ], - status: [ - { x: 1548697620000, up: 74, down: null, total: 74 }, - { x: 1548697920000, up: 75, down: null, total: 75 }, - { x: 1548698220000, up: 75, down: null, total: 75 }, - { x: 1548698520000, up: 73, down: null, total: 73 }, - { x: 1548698820000, up: 75, down: null, total: 75 }, - { x: 1548699120000, up: 74, down: null, total: 74 }, - { x: 1548699420000, up: 75, down: null, total: 75 }, - { x: 1548699720000, up: 75, down: null, total: 75 }, - { x: 1548700020000, up: 75, down: null, total: 75 }, - { x: 1548700320000, up: 75, down: null, total: 75 }, - { x: 1548700620000, up: 75, down: null, total: 75 }, - ], - statusMaxCount: 75, - durationMaxValue: 6669234, - }, - }; - it('renders the component without errors', () => { - const component = shallowWithRouter( - - ); + const component = shallowWithRouter(); expect(component).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/duration_charts.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/duration_charts.test.tsx.snap new file mode 100644 index 0000000000000..1e2d2b9144416 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/duration_charts.test.tsx.snap @@ -0,0 +1,111 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`MonitorCharts component renders the component without errors 1`] = ` + + + +`; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/duration_charts.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/duration_charts.test.tsx new file mode 100644 index 0000000000000..34a358171ead2 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/duration_charts.test.tsx @@ -0,0 +1,73 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React from 'react'; +import DateMath from '@elastic/datemath'; +import { DurationChartComponent } from '../duration_chart'; +import { MonitorDurationResult } from '../../../../../common/types'; +import { shallowWithRouter } from '../../../../lib'; + +describe('MonitorCharts component', () => { + let dateMathSpy: any; + const MOCK_DATE_VALUE = 20; + + beforeEach(() => { + dateMathSpy = jest.spyOn(DateMath, 'parse'); + dateMathSpy.mockReturnValue(MOCK_DATE_VALUE); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + const chartResponse: { monitorChartsData: MonitorDurationResult } = { + monitorChartsData: { + locationDurationLines: [ + { + name: 'somewhere', + line: [ + { x: 1548697620000, y: 743928.2027027027 }, + { x: 1548697920000, y: 766840.0133333333 }, + { x: 1548698220000, y: 786970.8266666667 }, + { x: 1548698520000, y: 781064.7808219178 }, + { x: 1548698820000, y: 741563.04 }, + { x: 1548699120000, y: 759354.6756756756 }, + { x: 1548699420000, y: 737533.3866666667 }, + { x: 1548699720000, y: 728669.0266666666 }, + { x: 1548700020000, y: 719951.64 }, + { x: 1548700320000, y: 769181.7866666666 }, + { x: 1548700620000, y: 740805.2666666667 }, + ], + }, + ], + status: [ + { x: 1548697620000, up: 74, down: null, total: 74 }, + { x: 1548697920000, up: 75, down: null, total: 75 }, + { x: 1548698220000, up: 75, down: null, total: 75 }, + { x: 1548698520000, up: 73, down: null, total: 73 }, + { x: 1548698820000, up: 75, down: null, total: 75 }, + { x: 1548699120000, up: 74, down: null, total: 74 }, + { x: 1548699420000, up: 75, down: null, total: 75 }, + { x: 1548699720000, up: 75, down: null, total: 75 }, + { x: 1548700020000, up: 75, down: null, total: 75 }, + { x: 1548700320000, up: 75, down: null, total: 75 }, + { x: 1548700620000, up: 75, down: null, total: 75 }, + ], + statusMaxCount: 75, + durationMaxValue: 6669234, + }, + }; + + it('renders the component without errors', () => { + const component = shallowWithRouter( + + ); + expect(component).toMatchSnapshot(); + }); +}); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/duration_chart.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/charts/duration_chart.tsx index 0488e2531bc98..d4e8e1ad08f0a 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/charts/duration_chart.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/charts/duration_chart.tsx @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n'; import moment from 'moment'; import { FormattedMessage } from '@kbn/i18n/react'; import { getChartDateLabel } from '../../../lib/helper'; -import { LocationDurationLine } from '../../../../common/graphql/types'; +import { LocationDurationLine } from '../../../../common/types'; import { DurationLineSeriesList } from './duration_line_series_list'; import { ChartWrapper } from './chart_wrapper'; import { useUrlParams } from '../../../hooks'; @@ -24,14 +24,6 @@ interface DurationChartProps { * on the duration chart. One entry per location */ locationDurationLines: LocationDurationLine[]; - /** - * The color to be used for the average duration series. - */ - meanColor: string; - /** - * The color to be used for the range duration series. - */ - rangeColor: string; /** * To represent the loading spinner on chart @@ -45,11 +37,7 @@ interface DurationChartProps { * milliseconds. * @param props The props required for this component to render properly */ -export const DurationChart = ({ - locationDurationLines, - meanColor, - loading, -}: DurationChartProps) => { +export const DurationChartComponent = ({ locationDurationLines, loading }: DurationChartProps) => { const hasLines = locationDurationLines.length > 0; const [getUrlParams, updateUrlParams] = useUrlParams(); const { absoluteDateRangeStart: min, absoluteDateRangeEnd: max } = getUrlParams(); @@ -99,7 +87,7 @@ export const DurationChart = ({ defaultMessage: 'Duration ms', })} /> - + ) : ( ( +export const DurationLineSeriesList = ({ lines }: Props) => ( <> {lines.map(({ name, line }) => ( [x, microsToMillis(y || null)])} id={`loc-avg-${name}`} key={`locline-${name}`} diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/index.ts b/x-pack/legacy/plugins/uptime/public/components/functional/charts/index.ts index 2cbd9a2b3aa32..983b831ca649e 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/charts/index.ts +++ b/x-pack/legacy/plugins/uptime/public/components/functional/charts/index.ts @@ -5,6 +5,6 @@ */ export { DonutChart } from './donut_chart'; -export { DurationChart } from './duration_chart'; +export { DurationChartComponent } from './duration_chart'; export { MonitorBarSeries } from './monitor_bar_series'; export { PingHistogramComponent } from './ping_histogram'; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_charts.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_charts.tsx index a5fbb78bdf059..c5edd0fd85977 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_charts.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_charts.tsx @@ -4,61 +4,23 @@ * you may not use this file except in compliance with the Elastic License. */ +import React from 'react'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React, { Fragment } from 'react'; -import { MonitorChart } from '../../../common/graphql/types'; -import { UptimeGraphQLQueryProps, withUptimeGraphQL } from '../higher_order'; -import { monitorChartsQuery } from '../../queries'; -import { DurationChart } from './charts'; -import { PingHistogram } from '../connected'; - -interface MonitorChartsQueryResult { - monitorChartsData?: MonitorChart; -} +import { PingHistogram, DurationChart } from '../connected'; interface MonitorChartsProps { monitorId: string; - danger: string; - mean: string; - range: string; - success: string; } -type Props = MonitorChartsProps & UptimeGraphQLQueryProps; - -export const MonitorChartsComponent = ({ data, mean, range, monitorId, loading }: Props) => { - if (data && data.monitorChartsData) { - const { - monitorChartsData: { locationDurationLines }, - } = data; - - return ( - - - - - - - - - ); - } +export const MonitorCharts = ({ monitorId }: MonitorChartsProps) => { return ( - - {i18n.translate('xpack.uptime.monitorCharts.loadingMessage', { - defaultMessage: 'Loading…', - })} - + + + + + + + + ); }; - -export const MonitorCharts = withUptimeGraphQL( - MonitorChartsComponent, - monitorChartsQuery -); diff --git a/x-pack/legacy/plugins/uptime/public/pages/monitor.tsx b/x-pack/legacy/plugins/uptime/public/pages/monitor.tsx index 8c608f57a9592..18c4927af0797 100644 --- a/x-pack/legacy/plugins/uptime/public/pages/monitor.tsx +++ b/x-pack/legacy/plugins/uptime/public/pages/monitor.tsx @@ -10,7 +10,7 @@ import { useParams } from 'react-router-dom'; import { ChromeBreadcrumb } from 'kibana/public'; import { connect, MapDispatchToPropsFunction, MapStateToPropsParam } from 'react-redux'; import { MonitorCharts, PingList } from '../components/functional'; -import { UptimeRefreshContext, UptimeThemeContext } from '../contexts'; +import { UptimeRefreshContext } from '../contexts'; import { useUptimeTelemetry, useUrlParams, UptimePage } from '../hooks'; import { useTrackPageview } from '../../../../../plugins/observability/public'; import { MonitorStatusDetails } from '../components/connected'; @@ -45,7 +45,6 @@ export const MonitorPageComponent: React.FC = ({ }, [dispatchGetMonitorStatus, monitorId]); const [pingListPageCount, setPingListPageCount] = useState(10); - const { colors } = useContext(UptimeThemeContext); const { refreshApp } = useContext(UptimeRefreshContext); const [getUrlParams, updateUrlParams] = useUrlParams(); const { absoluteDateRangeStart, absoluteDateRangeEnd, ...params } = getUrlParams(); @@ -73,7 +72,7 @@ export const MonitorPageComponent: React.FC = ({ - + ('GET_MONITOR_DURATION'); +export const getMonitorDurationActionSuccess = createAction( + 'GET_MONITOR_DURATION_SUCCESS' +); +export const getMonitorDurationActionFail = createAction('GET_MONITOR_DURATION_FAIL'); diff --git a/x-pack/legacy/plugins/uptime/public/state/api/index.ts b/x-pack/legacy/plugins/uptime/public/state/api/index.ts index 2d20638832335..7d42c6ee46bdc 100644 --- a/x-pack/legacy/plugins/uptime/public/state/api/index.ts +++ b/x-pack/legacy/plugins/uptime/public/state/api/index.ts @@ -10,3 +10,4 @@ export * from './snapshot'; export * from './monitor_status'; export * from './index_pattern'; export * from './ping'; +export * from './monitor_duration'; diff --git a/x-pack/legacy/plugins/uptime/public/state/api/monitor_duration.ts b/x-pack/legacy/plugins/uptime/public/state/api/monitor_duration.ts new file mode 100644 index 0000000000000..44e797457e5fd --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/state/api/monitor_duration.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { stringify } from 'query-string'; + +import { getApiPath } from '../../lib/helper'; +import { BaseParams } from './types'; + +export const fetchMonitorDuration = async ({ + basePath, + monitorId, + dateStart, + dateEnd, +}: BaseParams) => { + const url = getApiPath(`/api/uptime/monitor/duration`, basePath); + + const params = { + monitorId, + dateStart, + dateEnd, + }; + const urlParams = stringify(params); + + const response = await fetch(`${url}?${urlParams}`); + if (!response.ok) { + throw new Error(response.statusText); + } + return await response.json(); +}; diff --git a/x-pack/legacy/plugins/uptime/public/state/api/types.ts b/x-pack/legacy/plugins/uptime/public/state/api/types.ts index c88e111d778d5..a148f1c7d7ae3 100644 --- a/x-pack/legacy/plugins/uptime/public/state/api/types.ts +++ b/x-pack/legacy/plugins/uptime/public/state/api/types.ts @@ -11,6 +11,7 @@ export interface BaseParams { filters?: string; statusFilter?: string; location?: string; + monitorId?: string; } export type APIFn = (params: { basePath: string } & P) => Promise; diff --git a/x-pack/legacy/plugins/uptime/public/state/effects/index.ts b/x-pack/legacy/plugins/uptime/public/state/effects/index.ts index f809454cefb39..43af88f4cc291 100644 --- a/x-pack/legacy/plugins/uptime/public/state/effects/index.ts +++ b/x-pack/legacy/plugins/uptime/public/state/effects/index.ts @@ -11,6 +11,7 @@ import { fetchSnapshotCountEffect } from './snapshot'; import { fetchMonitorStatusEffect } from './monitor_status'; import { fetchIndexPatternEffect } from './index_pattern'; import { fetchPingHistogramEffect } from './ping'; +import { fetchMonitorDurationEffect } from './monitor_duration'; export function* rootEffect() { yield fork(fetchMonitorDetailsEffect); @@ -19,4 +20,5 @@ export function* rootEffect() { yield fork(fetchMonitorStatusEffect); yield fork(fetchIndexPatternEffect); yield fork(fetchPingHistogramEffect); + yield fork(fetchMonitorDurationEffect); } diff --git a/x-pack/legacy/plugins/uptime/public/state/effects/monitor_duration.ts b/x-pack/legacy/plugins/uptime/public/state/effects/monitor_duration.ts new file mode 100644 index 0000000000000..84b7eb14dcb2e --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/state/effects/monitor_duration.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { takeLatest } from 'redux-saga/effects'; +import { + getMonitorDurationAction, + getMonitorDurationActionFail, + getMonitorDurationActionSuccess, +} from '../actions'; + +import { fetchMonitorDuration } from '../api'; +import { fetchEffectFactory } from './fetch_effect'; + +export function* fetchMonitorDurationEffect() { + yield takeLatest( + getMonitorDurationAction, + fetchEffectFactory( + fetchMonitorDuration, + getMonitorDurationActionSuccess, + getMonitorDurationActionFail + ) + ); +} diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts b/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts index 842cb1e937108..32362afae42bc 100644 --- a/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts +++ b/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts @@ -12,6 +12,7 @@ import { uiReducer } from './ui'; import { monitorStatusReducer } from './monitor_status'; import { indexPatternReducer } from './index_pattern'; import { pingReducer } from './ping'; +import { monitorDurationReducer } from './monitor_duration'; export const rootReducer = combineReducers({ monitor: monitorReducer, @@ -21,4 +22,5 @@ export const rootReducer = combineReducers({ monitorStatus: monitorStatusReducer, indexPattern: indexPatternReducer, ping: pingReducer, + monitorDuration: monitorDurationReducer, }); diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/monitor_duration.ts b/x-pack/legacy/plugins/uptime/public/state/reducers/monitor_duration.ts new file mode 100644 index 0000000000000..a222764bd5d24 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/state/reducers/monitor_duration.ts @@ -0,0 +1,52 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { handleActions, Action } from 'redux-actions'; +import { + getMonitorDurationAction, + getMonitorDurationActionSuccess, + getMonitorDurationActionFail, +} from '../actions'; +import { MonitorDurationResult } from '../../../common/types'; + +export interface MonitorDuration { + monitor_duration: MonitorDurationResult | null; + errors: any[]; + loading: boolean; +} + +const initialState: MonitorDuration = { + monitor_duration: null, + loading: false, + errors: [], +}; + +type PayLoad = MonitorDurationResult & Error; + +export const monitorDurationReducer = handleActions( + { + [String(getMonitorDurationAction)]: (state: MonitorDuration) => ({ + ...state, + loading: true, + }), + + [String(getMonitorDurationActionSuccess)]: ( + state: MonitorDuration, + action: Action + ) => ({ + ...state, + loading: false, + monitor_duration: { ...action.payload }, + }), + + [String(getMonitorDurationActionFail)]: (state: MonitorDuration, action: Action) => ({ + ...state, + errors: [...state.errors, action.payload], + loading: false, + }), + }, + initialState +); diff --git a/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts b/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts index 2e27431a5ff14..24d34b4d067cc 100644 --- a/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts +++ b/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts @@ -55,6 +55,11 @@ describe('state selectors', () => { loading: false, errors: [], }, + monitorDuration: { + monitor_duration: null, + loading: false, + errors: [], + }, }; it('selects base path from state', () => { diff --git a/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts b/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts index 25498cc0cb0ee..0a914a14c372b 100644 --- a/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts +++ b/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts @@ -41,3 +41,7 @@ export const selectPingHistogram = ({ ping, ui }: AppState) => { esKuery: ui.esKuery, }; }; + +export const selectDurationLines = ({ monitorDuration }: AppState) => { + return monitorDuration; +}; diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 09ee5cd304ac9..43772f62bc19f 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -12670,7 +12670,6 @@ "xpack.uptime.locationName.helpLinkAnnotation": "場所を追加", "xpack.uptime.monitorCharts.durationChart.bottomAxis.title": "タイムスタンプ", "xpack.uptime.monitorCharts.durationChart.leftAxis.title": "期間ms", - "xpack.uptime.monitorCharts.loadingMessage": "読み込み中…", "xpack.uptime.monitorCharts.monitorDuration.titleLabel": "ミリ秒単位の監視時間", "xpack.uptime.monitorList.downLineSeries.downLabel": "ダウン", "xpack.uptime.monitorList.expandDrawerButton.ariaLabel": "ID {id}のモニターの行を展開", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 993beffe5fbf1..16ee94d33fbf6 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -12670,7 +12670,6 @@ "xpack.uptime.locationName.helpLinkAnnotation": "添加位置", "xpack.uptime.monitorCharts.durationChart.bottomAxis.title": "鏃堕棿鎴", "xpack.uptime.monitorCharts.durationChart.leftAxis.title": "持续时间 (ms)", - "xpack.uptime.monitorCharts.loadingMessage": "正在加载……", "xpack.uptime.monitorCharts.monitorDuration.titleLabel": "监测持续时间(毫秒)", "xpack.uptime.monitorList.downLineSeries.downLabel": "关闭", "xpack.uptime.monitorList.expandDrawerButton.ariaLabel": "展开 ID {id} 的监测行", diff --git a/x-pack/plugins/uptime/server/graphql/index.ts b/x-pack/plugins/uptime/server/graphql/index.ts index 007550da3cb62..49ba5583b417b 100644 --- a/x-pack/plugins/uptime/server/graphql/index.ts +++ b/x-pack/plugins/uptime/server/graphql/index.ts @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { createMonitorsResolvers, monitorsSchema } from './monitors'; import { createMonitorStatesResolvers, monitorStatesSchema } from './monitor_states'; import { createPingsResolvers, pingsSchema } from './pings'; import { CreateUMGraphQLResolvers } from './types'; @@ -12,14 +11,8 @@ import { unsignedIntegerResolverFunctions, unsignedIntegerSchema } from './unsig export { DEFAULT_GRAPHQL_PATH } from './constants'; export const resolvers: CreateUMGraphQLResolvers[] = [ - createMonitorsResolvers, createMonitorStatesResolvers, createPingsResolvers, unsignedIntegerResolverFunctions, ]; -export const typeDefs: any[] = [ - pingsSchema, - unsignedIntegerSchema, - monitorsSchema, - monitorStatesSchema, -]; +export const typeDefs: any[] = [pingsSchema, unsignedIntegerSchema, monitorStatesSchema]; diff --git a/x-pack/plugins/uptime/server/graphql/monitors/index.ts b/x-pack/plugins/uptime/server/graphql/monitors/index.ts deleted file mode 100644 index edf04a8acbb8a..0000000000000 --- a/x-pack/plugins/uptime/server/graphql/monitors/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -export { createMonitorsResolvers } from './resolvers'; -export { monitorsSchema } from './schema.gql'; diff --git a/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts deleted file mode 100644 index b39c5f42bfd75..0000000000000 --- a/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { UMGqlRange } from '../../../../../legacy/plugins/uptime/common/domain_types'; -import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; -import { - GetMonitorChartsDataQueryArgs, - MonitorChart, -} from '../../../../../legacy/plugins/uptime/common/graphql/types'; -import { UMServerLibs } from '../../lib/lib'; -import { CreateUMGraphQLResolvers, UMContext } from '../types'; - -export type UMMonitorsResolver = UMResolver, any, UMGqlRange, UMContext>; - -export type UMGetMonitorChartsResolver = UMResolver< - any | Promise, - any, - GetMonitorChartsDataQueryArgs, - UMContext ->; - -export const createMonitorsResolvers: CreateUMGraphQLResolvers = ( - libs: UMServerLibs -): { - Query: { - getMonitorChartsData: UMGetMonitorChartsResolver; - }; -} => ({ - Query: { - async getMonitorChartsData( - _resolver, - { monitorId, dateRangeStart, dateRangeEnd, location }, - { APICaller } - ): Promise { - return await libs.requests.getMonitorCharts({ - callES: APICaller, - monitorId, - dateRangeStart, - dateRangeEnd, - location, - }); - }, - }, -}); diff --git a/x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts deleted file mode 100644 index 6b8a896c4c60b..0000000000000 --- a/x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import gql from 'graphql-tag'; - -export const monitorsSchema = gql` - "Represents a bucket of monitor status information." - type StatusData { - "The timeseries point for this status data." - x: UnsignedInteger! - "The value of up counts for this point." - up: Int - "The value for down counts for this point." - down: Int - "The total down counts for this point." - total: Int - } - - "The data used to populate the monitor charts." - type MonitorChart { - "The average values for the monitor duration." - locationDurationLines: [LocationDurationLine!]! - "The counts of up/down checks for the monitor." - status: [StatusData!]! - "The maximum status doc count in this chart." - statusMaxCount: Int! - "The maximum duration value in this chart." - durationMaxValue: Int! - } - - type LocationDurationLine { - name: String! - line: [MonitorDurationAveragePoint!]! - } - - type MonitorKey { - key: String! - url: String - } - - type MonitorSeriesPoint { - x: UnsignedInteger - y: Int - } - - "Represents a monitor's duration performance in microseconds at a point in time." - type MonitorDurationAreaPoint { - "The timeseries value for this point in time." - x: UnsignedInteger! - "The min duration value in microseconds at this time." - yMin: Float - "The max duration value in microseconds at this point." - yMax: Float - } - - "Represents the average monitor duration ms at a point in time." - type MonitorDurationAveragePoint { - "The timeseries value for this point." - x: UnsignedInteger! - "The average duration ms for the monitor." - y: Float - } - - "Represents the latest recorded information about a monitor." - type LatestMonitor { - "The ID of the monitor represented by this data." - id: MonitorKey! - "Information from the latest document." - ping: Ping - "Buckets of recent up count status data." - upSeries: [MonitorSeriesPoint!] - "Buckets of recent down count status data." - downSeries: [MonitorSeriesPoint!] - } - - type LatestMonitorsResult { - monitors: [LatestMonitor!] - } - - extend type Query { - getMonitors( - dateRangeStart: String! - dateRangeEnd: String! - filters: String - statusFilter: String - ): LatestMonitorsResult - - getMonitorChartsData( - monitorId: String! - dateRangeStart: String! - dateRangeEnd: String! - location: String - ): MonitorChart - } -`; diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/__snapshots__/get_monitor_charts.test.ts.snap b/x-pack/plugins/uptime/server/lib/requests/__tests__/__snapshots__/get_monitor_charts.test.ts.snap index 7f0eb86dae751..5acf6ef40a1e3 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/__snapshots__/get_monitor_charts.test.ts.snap +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/__snapshots__/get_monitor_charts.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ElasticsearchMonitorsAdapter getMonitorChartsData will provide expected filters when a location is specified 1`] = ` +exports[`ElasticsearchMonitorsAdapter getMonitorChartsData will provide expected filters 1`] = ` Array [ "search", Object { @@ -57,11 +57,6 @@ Array [ "monitor.status": "up", }, }, - Object { - "term": Object { - "observer.geo.name": "Philadelphia", - }, - }, ], }, }, diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts index 205f9cf745db1..24411f48672cd 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts @@ -7,18 +7,18 @@ import { get, set } from 'lodash'; import mockChartsData from './monitor_charts_mock.json'; import { assertCloseTo } from '../../helper'; -import { getMonitorCharts } from '../get_monitor_charts'; +import { getMonitorDurationChart } from '../get_monitor_duration'; describe('ElasticsearchMonitorsAdapter', () => { it('getMonitorChartsData will run expected parameters when no location is specified', async () => { expect.assertions(3); const searchMock = jest.fn(); const search = searchMock.bind({}); - await getMonitorCharts({ + await getMonitorDurationChart({ callES: search, monitorId: 'fooID', - dateRangeStart: 'now-15m', - dateRangeEnd: 'now', + dateStart: 'now-15m', + dateEnd: 'now', }); expect(searchMock).toHaveBeenCalledTimes(1); // protect against possible rounding errors polluting the snapshot comparison @@ -45,16 +45,15 @@ describe('ElasticsearchMonitorsAdapter', () => { expect(searchMock.mock.calls[0]).toMatchSnapshot(); }); - it('getMonitorChartsData will provide expected filters when a location is specified', async () => { + it('getMonitorChartsData will provide expected filters', async () => { expect.assertions(3); const searchMock = jest.fn(); const search = searchMock.bind({}); - await getMonitorCharts({ + await getMonitorDurationChart({ callES: search, monitorId: 'fooID', - dateRangeStart: 'now-15m', - dateRangeEnd: 'now', - location: 'Philadelphia', + dateStart: 'now-15m', + dateEnd: 'now', }); expect(searchMock).toHaveBeenCalledTimes(1); // protect against possible rounding errors polluting the snapshot comparison @@ -86,11 +85,11 @@ describe('ElasticsearchMonitorsAdapter', () => { searchMock.mockReturnValue(mockChartsData); const search = searchMock.bind({}); expect( - await getMonitorCharts({ + await getMonitorDurationChart({ callES: search, monitorId: 'id', - dateRangeStart: 'now-15m', - dateRangeEnd: 'now', + dateStart: 'now-15m', + dateEnd: 'now', }) ).toMatchSnapshot(); }); diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_charts.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts similarity index 85% rename from x-pack/plugins/uptime/server/lib/requests/get_monitor_charts.ts rename to x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts index 7dd17ef9aa80f..5fb9df3738533 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_charts.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts @@ -8,19 +8,17 @@ import { UMElasticsearchQueryFn } from '../adapters'; import { INDEX_NAMES } from '../../../../../legacy/plugins/uptime/common/constants'; import { getHistogramIntervalFormatted } from '../helper'; import { - MonitorChart, LocationDurationLine, -} from '../../../../../legacy/plugins/uptime/common/graphql/types'; + MonitorDurationResult, +} from '../../../../../legacy/plugins/uptime/common/types'; export interface GetMonitorChartsParams { /** @member monitorId ID value for the selected monitor */ monitorId: string; - /** @member dateRangeStart timestamp bounds */ - dateRangeStart: string; + /** @member dateStart timestamp bounds */ + dateStart: string; /** @member dateRangeEnd timestamp bounds */ - dateRangeEnd: string; - /** @member location optional location value for use in filtering*/ - location?: string | null; + dateEnd: string; } const formatStatusBuckets = (time: any, buckets: any, docCount: any) => { @@ -46,21 +44,19 @@ const formatStatusBuckets = (time: any, buckets: any, docCount: any) => { /** * Fetches data used to populate monitor charts */ -export const getMonitorCharts: UMElasticsearchQueryFn< +export const getMonitorDurationChart: UMElasticsearchQueryFn< GetMonitorChartsParams, - MonitorChart -> = async ({ callES, dateRangeStart, dateRangeEnd, monitorId, location }) => { + MonitorDurationResult +> = async ({ callES, dateStart, dateEnd, monitorId }) => { const params = { index: INDEX_NAMES.HEARTBEAT, body: { query: { bool: { filter: [ - { range: { '@timestamp': { gte: dateRangeStart, lte: dateRangeEnd } } }, + { range: { '@timestamp': { gte: dateStart, lte: dateEnd } } }, { term: { 'monitor.id': monitorId } }, { term: { 'monitor.status': 'up' } }, - // if location is truthy, add it as a filter. otherwise add nothing - ...(!!location ? [{ term: { 'observer.geo.name': location } }] : []), ], }, }, @@ -69,7 +65,7 @@ export const getMonitorCharts: UMElasticsearchQueryFn< timeseries: { date_histogram: { field: '@timestamp', - fixed_interval: getHistogramIntervalFormatted(dateRangeStart, dateRangeEnd), + fixed_interval: getHistogramIntervalFormatted(dateStart, dateEnd), min_doc_count: 0, }, aggs: { @@ -104,7 +100,7 @@ export const getMonitorCharts: UMElasticsearchQueryFn< * Additionally, we supply the maximum value for duration and status, so the corresponding charts know * what the domain size should be. */ - const monitorChartsData: MonitorChart = { + const monitorChartsData: MonitorDurationResult = { locationDurationLines: [], status: [], durationMaxValue: 0, @@ -154,8 +150,6 @@ export const getMonitorCharts: UMElasticsearchQueryFn< // we must add null entries if (dateHistogramBucket.location.buckets.length < resultLocations.size) { resultLocations.forEach(resultLocation => { - // the current bucket has a value for this location, do nothing - if (location && location !== resultLocation) return; // the current bucket had no value for this location, insert a null value if (!bucketLocations.has(resultLocation)) { const locationLine = monitorChartsData.locationDurationLines.find( diff --git a/x-pack/plugins/uptime/server/lib/requests/index.ts b/x-pack/plugins/uptime/server/lib/requests/index.ts index 97517b7faad35..b1d7ff2c2ce02 100644 --- a/x-pack/plugins/uptime/server/lib/requests/index.ts +++ b/x-pack/plugins/uptime/server/lib/requests/index.ts @@ -8,7 +8,7 @@ export { getFilterBar, GetFilterBarParams } from './get_filter_bar'; export { getUptimeIndexPattern as getIndexPattern } from './get_index_pattern'; export { getLatestMonitor, GetLatestMonitorParams } from './get_latest_monitor'; export { getMonitor, GetMonitorParams } from './get_monitor'; -export { getMonitorCharts, GetMonitorChartsParams } from './get_monitor_charts'; +export { getMonitorDurationChart, GetMonitorChartsParams } from './get_monitor_duration'; export { getMonitorDetails, GetMonitorDetailsParams } from './get_monitor_details'; export { getMonitorLocations, GetMonitorLocationsParams } from './get_monitor_locations'; export { getMonitorStates, GetMonitorStatesParams } from './get_monitor_states'; diff --git a/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts b/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts index 8a411368c228f..6fd77afe711d4 100644 --- a/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts +++ b/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts @@ -7,7 +7,6 @@ import { UMElasticsearchQueryFn } from '../adapters'; import { Ping, - MonitorChart, PingResults, StatesIndexStatus, } from '../../../../../legacy/plugins/uptime/common/graphql/types'; @@ -30,7 +29,10 @@ import { } from '../../../../../legacy/plugins/uptime/common/runtime_types'; import { GetMonitorStatesResult } from './get_monitor_states'; import { GetSnapshotCountParams } from './get_snapshot_counts'; -import { HistogramResult } from '../../../../../legacy/plugins/uptime/common/types'; +import { + HistogramResult, + MonitorDurationResult, +} from '../../../../../legacy/plugins/uptime/common/types'; type ESQ = UMElasticsearchQueryFn; @@ -39,7 +41,7 @@ export interface UptimeRequests { getIndexPattern: ESQ; getLatestMonitor: ESQ; getMonitor: ESQ; - getMonitorCharts: ESQ; + getMonitorDurationChart: ESQ; getMonitorDetails: ESQ; getMonitorLocations: ESQ; getMonitorStates: ESQ; diff --git a/x-pack/plugins/uptime/server/rest_api/index.ts b/x-pack/plugins/uptime/server/rest_api/index.ts index aa3b36ec7d919..69981b7860d59 100644 --- a/x-pack/plugins/uptime/server/rest_api/index.ts +++ b/x-pack/plugins/uptime/server/rest_api/index.ts @@ -17,10 +17,12 @@ import { createGetStatusBarRoute, } from './monitors'; import { createGetPingHistogramRoute } from './pings/get_ping_histogram'; +import { createGetMonitorDurationRoute } from './monitors/monitors_durations'; export * from './types'; export { createRouteWithAuth } from './create_route_with_auth'; export { uptimeRouteWrapper } from './uptime_route_wrapper'; + export const restApiRoutes: UMRestApiRouteFactory[] = [ createGetOverviewFilters, createGetPingsRoute, @@ -33,4 +35,5 @@ export const restApiRoutes: UMRestApiRouteFactory[] = [ createLogMonitorPageRoute, createLogOverviewPageRoute, createGetPingHistogramRoute, + createGetMonitorDurationRoute, ]; diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts new file mode 100644 index 0000000000000..63e74175609ad --- /dev/null +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { schema } from '@kbn/config-schema'; +import { UMServerLibs } from '../../lib/lib'; +import { UMRestApiRouteFactory } from '../types'; + +export const createGetMonitorDurationRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ + method: 'GET', + path: '/api/uptime/monitor/duration', + validate: { + query: schema.object({ + monitorId: schema.string(), + dateStart: schema.string(), + dateEnd: schema.string(), + }), + }, + options: { + tags: ['access:uptime'], + }, + handler: async ({ callES }, _context, request, response): Promise => { + const { monitorId, dateStart, dateEnd } = request.query; + return response.ok({ + body: { + ...(await libs.requests.getMonitorDurationChart({ + callES, + monitorId, + dateStart, + dateEnd, + })), + }, + }); + }, +}); diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts.json deleted file mode 100644 index dbfc17a468796..0000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts.json +++ /dev/null @@ -1,275 +0,0 @@ -{ - "monitorChartsData": { - "locationDurationLines": [ - { - "name": "mpls", - "line": [ - { - "x": 1568172657286, - "y": 16274 - }, - { - "x": 1568172680087, - "y": 16713 - }, - { - "x": 1568172702888, - "y": 34756 - }, - { - "x": 1568172725689, - "y": null - }, - { - "x": 1568172748490, - "y": 22205 - }, - { - "x": 1568172771291, - "y": 6071 - }, - { - "x": 1568172794092, - "y": 15681 - }, - { - "x": 1568172816893, - "y": null - }, - { - "x": 1568172839694, - "y": 1669 - }, - { - "x": 1568172862495, - "y": 956 - }, - { - "x": 1568172885296, - "y": 1435 - }, - { - "x": 1568172908097, - "y": null - }, - { - "x": 1568172930898, - "y": 32906 - }, - { - "x": 1568172953699, - "y": 892 - }, - { - "x": 1568172976500, - "y": 1514 - }, - { - "x": 1568172999301, - "y": null - }, - { - "x": 1568173022102, - "y": 2367 - }, - { - "x": 1568173044903, - "y": 3389 - }, - { - "x": 1568173067704, - "y": 362 - }, - { - "x": 1568173090505, - "y": null - }, - { - "x": 1568173113306, - "y": 3066 - }, - { - "x": 1568173136107, - "y": 44513 - }, - { - "x": 1568173158908, - "y": 6417 - }, - { - "x": 1568173181709, - "y": 1416 - }, - { - "x": 1568173204510, - "y": null - }, - { - "x": 1568173227311, - "y": 24627 - } - ] - } - ], - "status": [ - { - "x": 1568172657286, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172680087, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172702888, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172725689, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568172748490, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172771291, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172794092, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172816893, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568172839694, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172862495, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172885296, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172908097, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568172930898, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172953699, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172976500, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568172999301, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568173022102, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568173044903, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568173067704, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568173090505, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568173113306, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568173136107, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568173158908, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568173181709, - "up": null, - "down": null, - "total": 1 - }, - { - "x": 1568173204510, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568173227311, - "up": null, - "down": null, - "total": 1 - } - ], - "statusMaxCount": 0, - "durationMaxValue": 0 - } -} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts_empty_set.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts_empty_set.json deleted file mode 100644 index d4257371553d6..0000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts_empty_set.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "monitorChartsData": { - "status": [], - "locationDurationLines": [], - "statusMaxCount": 0, - "durationMaxValue": 0 - } -} diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts_empty_sets.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts_empty_sets.json deleted file mode 100644 index b0b7d8e17391a..0000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_charts_empty_sets.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "monitorChartsData": { - "locationDurationLines": [], - "status": [], - "statusMaxCount": 0, - "durationMaxValue": 0 - } -} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/index.js b/x-pack/test/api_integration/apis/uptime/graphql/index.js index 54284377ec430..c2fdc57edede3 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/index.js +++ b/x-pack/test/api_integration/apis/uptime/graphql/index.js @@ -11,7 +11,6 @@ export default function({ loadTestFile }) { // verifying the pre-loaded documents are returned in a way that // matches the snapshots contained in './fixtures' loadTestFile(require.resolve('./doc_count')); - loadTestFile(require.resolve('./monitor_charts')); loadTestFile(require.resolve('./monitor_states')); loadTestFile(require.resolve('./ping_list')); }); diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js b/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js deleted file mode 100644 index baa7104e02219..0000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_charts.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { monitorChartsQueryString } from '../../../../../legacy/plugins/uptime/public/queries'; -import { expectFixtureEql } from './helpers/expect_fixture_eql'; - -export default function({ getService }) { - describe('monitorCharts query', () => { - before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); - after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat')); - - const supertest = getService('supertest'); - - it('will fetch a series of data points for monitor duration and status', async () => { - const getMonitorChartsQuery = { - operationName: 'MonitorCharts', - query: monitorChartsQueryString, - variables: { - dateRangeStart: '2019-09-11T03:31:04.380Z', - dateRangeEnd: '2019-09-11T03:40:34.410Z', - monitorId: '0002-up', - }, - }; - const { - body: { data }, - } = await supertest - .post('/api/uptime/graphql') - .set('kbn-xsrf', 'foo') - .send({ ...getMonitorChartsQuery }); - - expectFixtureEql(data, 'monitor_charts'); - }); - - it('will fetch empty sets for a date range with no data', async () => { - const getMonitorChartsQuery = { - operationName: 'MonitorCharts', - query: monitorChartsQueryString, - variables: { - dateRangeStart: '1999-09-11T03:31:04.380Z', - dateRangeEnd: '1999-09-11T03:40:34.410Z', - monitorId: '0002-up', - }, - }; - const { - body: { data }, - } = await supertest - .post('/api/uptime/graphql') - .set('kbn-xsrf', 'foo') - .send({ ...getMonitorChartsQuery }); - - expectFixtureEql(data, 'monitor_charts_empty_sets'); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts.json new file mode 100644 index 0000000000000..1aa0788a6da05 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts.json @@ -0,0 +1,273 @@ +{ + "locationDurationLines": [ + { + "name": "mpls", + "line": [ + { + "x": 1568172657286, + "y": 16274 + }, + { + "x": 1568172680087, + "y": 16713 + }, + { + "x": 1568172702888, + "y": 34756 + }, + { + "x": 1568172725689, + "y": null + }, + { + "x": 1568172748490, + "y": 22205 + }, + { + "x": 1568172771291, + "y": 6071 + }, + { + "x": 1568172794092, + "y": 15681 + }, + { + "x": 1568172816893, + "y": null + }, + { + "x": 1568172839694, + "y": 1669 + }, + { + "x": 1568172862495, + "y": 956 + }, + { + "x": 1568172885296, + "y": 1435 + }, + { + "x": 1568172908097, + "y": null + }, + { + "x": 1568172930898, + "y": 32906 + }, + { + "x": 1568172953699, + "y": 892 + }, + { + "x": 1568172976500, + "y": 1514 + }, + { + "x": 1568172999301, + "y": null + }, + { + "x": 1568173022102, + "y": 2367 + }, + { + "x": 1568173044903, + "y": 3389 + }, + { + "x": 1568173067704, + "y": 362 + }, + { + "x": 1568173090505, + "y": null + }, + { + "x": 1568173113306, + "y": 3066 + }, + { + "x": 1568173136107, + "y": 44513 + }, + { + "x": 1568173158908, + "y": 6417 + }, + { + "x": 1568173181709, + "y": 1416 + }, + { + "x": 1568173204510, + "y": null + }, + { + "x": 1568173227311, + "y": 24627 + } + ] + } + ], + "status": [ + { + "x": 1568172657286, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172680087, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172702888, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172725689, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568172748490, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172771291, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172794092, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172816893, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568172839694, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172862495, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172885296, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172908097, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568172930898, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172953699, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172976500, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568172999301, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568173022102, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173044903, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173067704, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173090505, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568173113306, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173136107, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173158908, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173181709, + "up": null, + "down": null, + "total": 1 + }, + { + "x": 1568173204510, + "up": null, + "down": null, + "total": 0 + }, + { + "x": 1568173227311, + "up": null, + "down": null, + "total": 1 + } + ], + "statusMaxCount": 0, + "durationMaxValue": 0 +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts_empty_sets.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts_empty_sets.json new file mode 100644 index 0000000000000..e7245a479a962 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts_empty_sets.json @@ -0,0 +1,6 @@ +{ + "locationDurationLines": [], + "status": [], + "statusMaxCount": 0, + "durationMaxValue": 0 +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/index.ts b/x-pack/test/api_integration/apis/uptime/rest/index.ts index 30c301c5ecb17..5e26cb9216f45 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/index.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/index.ts @@ -20,6 +20,7 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./monitor_latest_status')); loadTestFile(require.resolve('./selected_monitor')); loadTestFile(require.resolve('./ping_histogram')); + loadTestFile(require.resolve('./monitor_duration')); }); }); } diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts new file mode 100644 index 0000000000000..acc50e9b8f3d6 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { expectFixtureEql } from '../graphql/helpers/expect_fixture_eql'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function({ getService }: FtrProviderContext) { + describe('monitor duration query', () => { + const supertest = getService('supertest'); + + it('will fetch a series of data points for monitor duration and status', async () => { + const dateStart = '2019-09-11T03:31:04.380Z'; + const dateEnd = '2019-09-11T03:40:34.410Z'; + + const monitorId = '0002-up'; + + const apiResponse = await supertest.get( + `/api/uptime/monitor/duration?monitorId=${monitorId}&dateStart=${dateStart}&dateEnd=${dateEnd}` + ); + const data = apiResponse.body; + expectFixtureEql(data, 'monitor_charts'); + }); + + it('will fetch empty sets for a date range with no data', async () => { + const dateStart = '1999-09-11T03:31:04.380Z'; + const dateEnd = '1999-09-11T03:40:34.410Z'; + + const monitorId = '0002-up'; + + const apiResponse = await supertest.get( + `/api/uptime/monitor/duration?monitorId=${monitorId}&dateStart=${dateStart}&dateEnd=${dateEnd}` + ); + const data = apiResponse.body; + + expectFixtureEql(data, 'monitor_charts_empty_sets'); + }); + }); +}