;
-}
-
-export interface HistogramQueryResult {
- key: number;
- key_as_string: string;
- doc_count: number;
- down: {
- doc_count: number;
- };
- up: {
- doc_count: number;
- };
-}
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 9d3fa5aa08aed..e9a7aa94dd3aa 100644
--- a/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts
+++ b/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts
@@ -5,7 +5,12 @@
*/
import { UMElasticsearchQueryFn } from '../adapters';
-import { Ping, PingResults } from '../../../../../legacy/plugins/uptime/common/graphql/types';
+import {
+ HistogramResult,
+ Ping,
+ PingsResponse as PingResults,
+ GetPingsParams,
+} from '../../../../../legacy/plugins/uptime/common/runtime_types';
import {
GetFilterBarParams,
GetLatestMonitorParams,
@@ -13,7 +18,6 @@ import {
GetMonitorDetailsParams,
GetMonitorLocationsParams,
GetMonitorStatesParams,
- GetPingsParams,
GetPingHistogramParams,
GetMonitorStatusParams,
GetMonitorStatusResult,
@@ -27,10 +31,7 @@ import {
} from '../../../../../legacy/plugins/uptime/common/runtime_types';
import { GetMonitorStatesResult } from './get_monitor_states';
import { GetSnapshotCountParams } from './get_snapshot_counts';
-import {
- HistogramResult,
- MonitorDurationResult,
-} from '../../../../../legacy/plugins/uptime/common/types';
+import { MonitorDurationResult } from '../../../../../legacy/plugins/uptime/common/types';
type ESQ = UMElasticsearchQueryFn
;
diff --git a/x-pack/plugins/uptime/server/rest_api/index.ts b/x-pack/plugins/uptime/server/rest_api/index.ts
index c84ea71037953..c0412e588fa93 100644
--- a/x-pack/plugins/uptime/server/rest_api/index.ts
+++ b/x-pack/plugins/uptime/server/rest_api/index.ts
@@ -5,7 +5,7 @@
*/
import { createGetOverviewFilters } from './overview_filters';
-import { createGetPingsRoute } from './pings';
+import { createGetPingHistogramRoute, createGetPingsRoute } from './pings';
import { createGetDynamicSettingsRoute, createPostDynamicSettingsRoute } from './dynamic_settings';
import { createLogPageViewRoute } from './telemetry';
import { createGetSnapshotCount } from './snapshot';
@@ -15,10 +15,8 @@ import {
createGetMonitorLocationsRoute,
createGetStatusBarRoute,
} from './monitors';
-import { createGetPingHistogramRoute } from './pings/get_ping_histogram';
import { createGetMonitorDurationRoute } from './monitors/monitors_durations';
import { createGetIndexPatternRoute, createGetIndexStatusRoute } from './index_state';
-
export * from './types';
export { createRouteWithAuth } from './create_route_with_auth';
export { uptimeRouteWrapper } from './uptime_route_wrapper';
diff --git a/x-pack/plugins/uptime/server/rest_api/pings/get_all.ts b/x-pack/plugins/uptime/server/rest_api/pings/get_all.ts
deleted file mode 100644
index c76892103da6b..0000000000000
--- a/x-pack/plugins/uptime/server/rest_api/pings/get_all.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 { schema } from '@kbn/config-schema';
-import { UMServerLibs } from '../../lib/lib';
-import { UMRestApiRouteFactory } from '../types';
-import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants/rest_api';
-
-export const createGetAllRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({
- method: 'GET',
- path: API_URLS.PINGS,
- validate: {
- query: schema.object({
- dateRangeStart: schema.string(),
- dateRangeEnd: schema.string(),
- location: schema.maybe(schema.string()),
- monitorId: schema.maybe(schema.string()),
- size: schema.maybe(schema.number()),
- sort: schema.maybe(schema.string()),
- status: schema.maybe(schema.string()),
- }),
- },
- handler: async ({ callES, dynamicSettings }, _context, request, response): Promise => {
- const { dateRangeStart, dateRangeEnd, location, monitorId, size, sort, status } = request.query;
-
- const result = await libs.requests.getPings({
- callES,
- dynamicSettings,
- dateRangeStart,
- dateRangeEnd,
- monitorId,
- status,
- sort,
- size,
- location,
- });
-
- return response.ok({
- body: {
- ...result,
- },
- });
- },
-});
diff --git a/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts b/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts
index cde9a8c4e47ea..80a887a7f64a9 100644
--- a/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts
+++ b/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts
@@ -5,37 +5,41 @@
*/
import { schema } from '@kbn/config-schema';
+import { isLeft } from 'fp-ts/lib/Either';
+import { PathReporter } from 'io-ts/lib/PathReporter';
import { UMServerLibs } from '../../lib/lib';
import { UMRestApiRouteFactory } from '../types';
import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants/rest_api';
+import { GetPingsParamsType } from '../../../../../legacy/plugins/uptime/common/runtime_types';
export const createGetPingsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({
method: 'GET',
path: API_URLS.PINGS,
validate: {
query: schema.object({
- dateRangeStart: schema.string(),
- dateRangeEnd: schema.string(),
+ from: schema.string(),
+ to: schema.string(),
location: schema.maybe(schema.string()),
monitorId: schema.maybe(schema.string()),
+ index: schema.maybe(schema.number()),
size: schema.maybe(schema.number()),
sort: schema.maybe(schema.string()),
status: schema.maybe(schema.string()),
}),
},
handler: async ({ callES, dynamicSettings }, _context, request, response): Promise => {
- const { dateRangeStart, dateRangeEnd, location, monitorId, size, sort, status } = request.query;
+ const { from, to, ...optional } = request.query;
+ const params = GetPingsParamsType.decode({ dateRange: { from, to }, ...optional });
+ if (isLeft(params)) {
+ // eslint-disable-next-line no-console
+ console.error(new Error(PathReporter.report(params).join(';')));
+ return response.badRequest({ body: { message: 'Received invalid request parameters.' } });
+ }
const result = await libs.requests.getPings({
callES,
dynamicSettings,
- dateRangeStart,
- dateRangeEnd,
- monitorId,
- status,
- sort,
- size,
- location,
+ ...params.right,
});
return response.ok({
diff --git a/x-pack/plugins/uptime/server/rest_api/pings/index.ts b/x-pack/plugins/uptime/server/rest_api/pings/index.ts
index abb7da26f994f..a10ab435e4b0a 100644
--- a/x-pack/plugins/uptime/server/rest_api/pings/index.ts
+++ b/x-pack/plugins/uptime/server/rest_api/pings/index.ts
@@ -5,3 +5,4 @@
*/
export { createGetPingsRoute } from './get_pings';
+export { createGetPingHistogramRoute } from './get_ping_histogram';
diff --git a/x-pack/test/api_integration/apis/uptime/feature_controls.ts b/x-pack/test/api_integration/apis/uptime/feature_controls.ts
index 4c3b7f97c9544..8b82735fc38b0 100644
--- a/x-pack/test/api_integration/apis/uptime/feature_controls.ts
+++ b/x-pack/test/api_integration/apis/uptime/feature_controls.ts
@@ -40,7 +40,7 @@ export default function featureControlsTests({ getService }: FtrProviderContext)
const executePingsRequest = async (username: string, password: string, spaceId?: string) => {
const basePath = spaceId ? `/s/${spaceId}` : '';
- const url = `${basePath}${API_URLS.PINGS}?sort=desc&dateRangeStart=${PINGS_DATE_RANGE_START}&dateRangeEnd=${PINGS_DATE_RANGE_END}`;
+ const url = `${basePath}${API_URLS.PINGS}?sort=desc&from=${PINGS_DATE_RANGE_START}&to=${PINGS_DATE_RANGE_END}`;
return await supertest
.get(url)
.auth(username, password)
diff --git a/x-pack/test/api_integration/apis/uptime/get_all_pings.ts b/x-pack/test/api_integration/apis/uptime/get_all_pings.ts
index 666986e7008b7..0b3f5faccb044 100644
--- a/x-pack/test/api_integration/apis/uptime/get_all_pings.ts
+++ b/x-pack/test/api_integration/apis/uptime/get_all_pings.ts
@@ -22,7 +22,7 @@ export default function({ getService }: FtrProviderContext) {
it('should get all pings stored in index', async () => {
const { body: apiResponse } = await supertest
.get(
- `/api/uptime/pings?sort=desc&dateRangeStart=${PINGS_DATE_RANGE_START}&dateRangeEnd=${PINGS_DATE_RANGE_END}`
+ `/api/uptime/pings?sort=desc&from=${PINGS_DATE_RANGE_START}&to=${PINGS_DATE_RANGE_END}`
)
.expect(200);
@@ -33,21 +33,19 @@ export default function({ getService }: FtrProviderContext) {
it('should sort pings according to timestamp', async () => {
const { body: apiResponse } = await supertest
- .get(
- `/api/uptime/pings?sort=asc&dateRangeStart=${PINGS_DATE_RANGE_START}&dateRangeEnd=${PINGS_DATE_RANGE_END}`
- )
+ .get(`/api/uptime/pings?sort=asc&from=${PINGS_DATE_RANGE_START}&to=${PINGS_DATE_RANGE_END}`)
.expect(200);
expect(apiResponse.total).to.be(2);
expect(apiResponse.pings.length).to.be(2);
- expect(apiResponse.pings[0].timestamp).to.be('2018-10-30T14:49:23.889Z');
- expect(apiResponse.pings[1].timestamp).to.be('2018-10-30T18:51:56.792Z');
+ expect(apiResponse.pings[0]['@timestamp']).to.be('2018-10-30T14:49:23.889Z');
+ expect(apiResponse.pings[1]['@timestamp']).to.be('2018-10-30T18:51:56.792Z');
});
it('should return results of n length', async () => {
const { body: apiResponse } = await supertest
.get(
- `/api/uptime/pings?sort=desc&size=1&dateRangeStart=${PINGS_DATE_RANGE_START}&dateRangeEnd=${PINGS_DATE_RANGE_END}`
+ `/api/uptime/pings?sort=desc&size=1&from=${PINGS_DATE_RANGE_START}&to=${PINGS_DATE_RANGE_END}`
)
.expect(200);
@@ -57,10 +55,10 @@ export default function({ getService }: FtrProviderContext) {
});
it('should miss pings outside of date range', async () => {
- const dateRangeStart = moment('2002-01-01').valueOf();
- const dateRangeEnd = moment('2002-01-02').valueOf();
+ const from = moment('2002-01-01').valueOf();
+ const to = moment('2002-01-02').valueOf();
const { body: apiResponse } = await supertest
- .get(`/api/uptime/pings?dateRangeStart=${dateRangeStart}&dateRangeEnd=${dateRangeEnd}`)
+ .get(`/api/uptime/pings?from=${from}&to=${to}`)
.expect(200);
expect(apiResponse.total).to.be(0);
diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list.json
deleted file mode 100644
index 330ec83931a62..0000000000000
--- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list.json
+++ /dev/null
@@ -1,320 +0,0 @@
-{
- "allPings": {
- "total": 2000,
- "locations": [
- "mpls"
- ],
- "pings": [
- {
- "timestamp": "2019-09-11T03:40:34.410Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 413
- },
- "id": "0074-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.406Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 441
- },
- "id": "0073-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.406Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 482
- },
- "id": "0099-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.406Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 558
- },
- "id": "0098-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.406Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 304
- },
- "id": "0075-intermittent",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.405Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 487
- },
- "id": "0097-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.405Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 602
- },
- "id": "0049-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.390Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 365
- },
- "id": "0047-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.389Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 870
- },
- "id": "0077-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.387Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 2808
- },
- "id": "0076-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_count.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_count.json
deleted file mode 100644
index 3a619f517626a..0000000000000
--- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_count.json
+++ /dev/null
@@ -1,1569 +0,0 @@
-{
- "allPings": {
- "total": 2000,
- "locations": [
- "mpls"
- ],
- "pings": [
- {
- "timestamp": "2019-09-11T03:40:34.410Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 413
- },
- "id": "0074-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.406Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 441
- },
- "id": "0073-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.406Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 482
- },
- "id": "0099-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.406Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 558
- },
- "id": "0098-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.406Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 304
- },
- "id": "0075-intermittent",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.405Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 487
- },
- "id": "0097-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.405Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 602
- },
- "id": "0049-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.390Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 365
- },
- "id": "0047-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.389Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 870
- },
- "id": "0077-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.387Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 2808
- },
- "id": "0076-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.386Z",
- "http": {
- "response": {
- "status_code": 400,
- "body": {
- "bytes": 3,
- "hash": "26d228663f13a88592a12d16cf9587caab0388b262d6d9f126ed62f9333aca94",
- "content": "400",
- "content_bytes": 3
- }
- }
- },
- "error": {
- "message": "400 Bad Request",
- "type": "validate"
- },
- "monitor": {
- "duration": {
- "us": 4258
- },
- "id": "0050-down",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "down",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.386Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 4784
- },
- "id": "0048-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.376Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 14580
- },
- "id": "0072-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.376Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 14679
- },
- "id": "0096-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.375Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 15308
- },
- "id": "0092-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.375Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 15183
- },
- "id": "0069-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.375Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 15013
- },
- "id": "0093-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.375Z",
- "http": {
- "response": {
- "status_code": 400,
- "body": {
- "bytes": 3,
- "hash": "26d228663f13a88592a12d16cf9587caab0388b262d6d9f126ed62f9333aca94",
- "content": "400",
- "content_bytes": 3
- }
- }
- },
- "error": {
- "message": "400 Bad Request",
- "type": "validate"
- },
- "monitor": {
- "duration": {
- "us": 15117
- },
- "id": "0070-down",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "down",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.375Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 14875
- },
- "id": "0071-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.375Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 14801
- },
- "id": "0095-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.375Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 15065
- },
- "id": "0032-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.375Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 14911
- },
- "id": "0094-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.374Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 16135
- },
- "id": "0046-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.374Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 15428
- },
- "id": "0091-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.374Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 15499
- },
- "id": "0067-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.374Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 15464
- },
- "id": "0068-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.374Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 21736
- },
- "id": "0090-intermittent",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.374Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 21874
- },
- "id": "0031-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.374Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 36584
- },
- "id": "0066-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 3148
- },
- "id": "0084-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 13442
- },
- "id": "0083-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 13666
- },
- "id": "0041-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 16290
- },
- "id": "0045-intermittent",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 17255
- },
- "id": "0042-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 500,
- "body": {
- "bytes": 3,
- "hash": "0604cd3138feed202ef293e062da2f4720f77a05d25ee036a7a01c9cfcdd1f0a",
- "content": "500",
- "content_bytes": 3
- }
- }
- },
- "error": {
- "message": "500 Internal Server Error",
- "type": "validate"
- },
- "monitor": {
- "duration": {
- "us": 17146
- },
- "id": "0030-intermittent",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "down",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 17770
- },
- "id": "0063-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 18194
- },
- "id": "0061-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 17587
- },
- "id": "0065-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 22666
- },
- "id": "0062-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 33311
- },
- "id": "0026-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 33506
- },
- "id": "0085-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 33974
- },
- "id": "0025-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 33693
- },
- "id": "0088-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 33833
- },
- "id": "0089-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 34600
- },
- "id": "0087-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 35573
- },
- "id": "0028-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 35830
- },
- "id": "0086-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 35698
- },
- "id": "0064-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 35594
- },
- "id": "0029-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 35652
- },
- "id": "0044-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_monitor_id.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_monitor_id.json
deleted file mode 100644
index 5826fd9f3f540..0000000000000
--- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_monitor_id.json
+++ /dev/null
@@ -1,475 +0,0 @@
-{
- "allPings": {
- "total": 20,
- "locations": [
- "mpls"
- ],
- "pings": [
- {
- "timestamp": "2019-09-11T03:40:34.371Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 35534
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:40:04.370Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 3080
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:39:34.370Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 7810
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:39:04.371Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 1575
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:38:34.370Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 1787
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:38:04.370Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 654
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:37:34.370Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 15915
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:37:04.370Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 2679
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:36:34.371Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 2104
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:36:04.370Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 5759
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:35:34.373Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 7166
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:35:04.371Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 26830
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:34:34.371Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 993
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:34:04.381Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 3880
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:33:34.371Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 1604
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_sort.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_sort.json
deleted file mode 100644
index b9b8deae2e564..0000000000000
--- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/ping_list_sort.json
+++ /dev/null
@@ -1,165 +0,0 @@
-{
- "allPings": {
- "total": 20,
- "locations": [
- "mpls"
- ],
- "pings": [
- {
- "timestamp": "2019-09-11T03:31:04.380Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 56940
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:31:34.366Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 9861
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:32:04.372Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 2924
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:32:34.375Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 21665
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- },
- {
- "timestamp": "2019-09-11T03:33:04.370Z",
- "http": {
- "response": {
- "status_code": 200,
- "body": {
- "bytes": 3,
- "hash": "27badc983df1780b60c2b3fa9d3a19a00e46aac798451f0febdca52920faaddf",
- "content": null,
- "content_bytes": null
- }
- }
- },
- "error": null,
- "monitor": {
- "duration": {
- "us": 2128
- },
- "id": "0001-up",
- "ip": "127.0.0.1",
- "name": "",
- "scheme": null,
- "status": "up",
- "type": "http"
- },
- "observer": {
- "geo": {
- "name": "mpls"
- }
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/x-pack/test/api_integration/apis/uptime/graphql/index.ts b/x-pack/test/api_integration/apis/uptime/graphql/index.ts
index 2e0b5e2eea2a5..862cce47f257a 100644
--- a/x-pack/test/api_integration/apis/uptime/graphql/index.ts
+++ b/x-pack/test/api_integration/apis/uptime/graphql/index.ts
@@ -13,6 +13,5 @@ export default function({ loadTestFile }: FtrProviderContext) {
// verifying the pre-loaded documents are returned in a way that
// matches the snapshots contained in './fixtures'
loadTestFile(require.resolve('./monitor_states'));
- loadTestFile(require.resolve('./ping_list'));
});
}
diff --git a/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts b/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts
deleted file mode 100644
index c84b9c382acdd..0000000000000
--- a/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts
+++ /dev/null
@@ -1,116 +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 expect from '@kbn/expect';
-import { pingsQueryString } from '../../../../../legacy/plugins/uptime/public/queries';
-import { expectFixtureEql } from './helpers/expect_fixture_eql';
-import { Ping, PingResults } from '../../../../../legacy/plugins/uptime/common/graphql/types';
-
-const expectPingFixtureEql = (data: { allPings: PingResults }, fixtureName: string) => {
- expectFixtureEql(data, fixtureName, d => d.allPings.pings.forEach((p: Ping) => delete p.id));
-};
-
-export default function({ getService }: any) {
- describe('pingList 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('returns a list of pings for the given date range and default size', async () => {
- const getPingsQuery = {
- operationName: 'PingList',
- query: pingsQueryString,
- variables: {
- dateRangeStart: '2019-01-28T17:40:08.078Z',
- dateRangeEnd: '2025-01-28T19:00:16.078Z',
- },
- };
- const {
- body: { data },
- } = await supertest
- .post('/api/uptime/graphql')
- .set('kbn-xsrf', 'foo')
- .send({ ...getPingsQuery });
- const {
- allPings: { pings },
- } = data;
- expect(pings).length(10);
-
- expectPingFixtureEql(data, 'ping_list');
- });
-
- it('returns a list of pings for the date range and given size', async () => {
- const SIZE = 50;
- const getPingsQuery = {
- operationName: 'PingList',
- query: pingsQueryString,
- variables: {
- dateRangeStart: '2019-01-28T17:40:08.078Z',
- dateRangeEnd: '2025-01-28T19:00:16.078Z',
- size: SIZE,
- },
- };
- const {
- body: { data },
- } = await supertest
- .post('/api/uptime/graphql')
- .set('kbn-xsrf', 'foo')
- .send({ ...getPingsQuery });
- const {
- allPings: { pings },
- } = data;
- expect(pings).length(SIZE);
- expectPingFixtureEql(data, 'ping_list_count');
- });
-
- it('returns a list of pings for a monitor ID', async () => {
- const SIZE = 15;
- const MONITOR_ID = '0001-up';
- const getPingsQuery = {
- operationName: 'PingList',
- query: pingsQueryString,
- variables: {
- dateRangeStart: '2019-01-28T17:40:08.078Z',
- dateRangeEnd: '2025-01-28T19:00:16.078Z',
- monitorId: MONITOR_ID,
- size: SIZE,
- },
- };
- const {
- body: { data },
- } = await supertest
- .post('/api/uptime/graphql')
- .set('kbn-xsrf', 'foo')
- .send({ ...getPingsQuery });
- expectPingFixtureEql(data, 'ping_list_monitor_id');
- });
-
- it('returns a list of pings sorted ascending', async () => {
- const SIZE = 5;
- const MONITOR_ID = '0001-up';
- const getPingsQuery = {
- operationName: 'PingList',
- query: pingsQueryString,
- variables: {
- dateRangeStart: '2019-01-28T17:40:08.078Z',
- dateRangeEnd: '2025-01-28T19:00:16.078Z',
- monitorId: MONITOR_ID,
- size: SIZE,
- sort: 'asc',
- },
- };
- const {
- body: { data },
- } = await supertest
- .post('/api/uptime/graphql')
- .set('kbn-xsrf', 'foo')
- .send({ ...getPingsQuery });
-
- expectPingFixtureEql(data, 'ping_list_sort');
- });
- });
-}
diff --git a/x-pack/test/api_integration/apis/uptime/index.ts b/x-pack/test/api_integration/apis/uptime/index.ts
index a21db08d58c4d..8def64b71a110 100644
--- a/x-pack/test/api_integration/apis/uptime/index.ts
+++ b/x-pack/test/api_integration/apis/uptime/index.ts
@@ -10,11 +10,12 @@ export default function({ getService, loadTestFile }: FtrProviderContext) {
const es = getService('legacyEs');
describe('uptime', () => {
- before(() =>
- es.indices.delete({
- index: 'heartbeat*',
- ignore: [404],
- })
+ before(
+ async () =>
+ await es.indices.delete({
+ index: 'heartbeat*',
+ ignore: [404],
+ })
);
loadTestFile(require.resolve('./feature_controls'));
diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_latest_status.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_latest_status.json
index 2e5854f4d9866..6a832ad8536f7 100644
--- a/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_latest_status.json
+++ b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_latest_status.json
@@ -1,16 +1,11 @@
{
- "timestamp": "2019-09-11T03:40:34.371Z",
"observer": {
- "geo": {
- "name": "mpls",
- "location": "37.926868, -78.024902"
- },
+ "geo": { "name": "mpls", "location": "37.926868, -78.024902" },
"hostname": "avc-x1x"
},
+ "@timestamp": "2019-09-11T03:40:34.371Z",
"monitor": {
- "duration": {
- "us": 24627
- },
+ "duration": { "us": 24627 },
"ip": "127.0.0.1",
"name": "",
"check_group": "d76f0762-d445-11e9-88e3-3e80641b9c71",
@@ -25,5 +20,7 @@
"domain": "localhost",
"query": "r=200x1",
"full": "http://localhost:5678/pattern?r=200x1"
- }
+ },
+ "docId": "h5toHm0B0I9WX_CznN_V",
+ "timestamp": "2019-09-11T03:40:34.371Z"
}
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 9b0cd61c22462..3f8df81856f5c 100644
--- a/x-pack/test/api_integration/apis/uptime/rest/index.ts
+++ b/x-pack/test/api_integration/apis/uptime/rest/index.ts
@@ -45,10 +45,11 @@ export default function({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./telemetry_collectors'));
});
describe('with real-world data', () => {
- before('load heartbeat data', async () => await esArchiver.load('uptime/full_heartbeat'));
- after('unload', async () => await esArchiver.unload('uptime/full_heartbeat'));
+ beforeEach('load heartbeat data', async () => await esArchiver.load('uptime/full_heartbeat'));
+ afterEach('unload', async () => await esArchiver.unload('uptime/full_heartbeat'));
loadTestFile(require.resolve('./monitor_latest_status'));
loadTestFile(require.resolve('./ping_histogram'));
+ loadTestFile(require.resolve('./ping_list'));
loadTestFile(require.resolve('./monitor_duration'));
loadTestFile(require.resolve('./doc_count'));
});
diff --git a/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts b/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts
new file mode 100644
index 0000000000000..a261763d5991f
--- /dev/null
+++ b/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts
@@ -0,0 +1,178 @@
+/*
+ * 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 expect from '@kbn/expect';
+import { isLeft } from 'fp-ts/lib/Either';
+import { PathReporter } from 'io-ts/lib/PathReporter';
+import { PingsResponseType } from '../../../../../legacy/plugins/uptime/common/runtime_types';
+import { FtrProviderContext } from '../../../ftr_provider_context';
+
+function decodePingsResponseData(response: any) {
+ const decoded = PingsResponseType.decode(response);
+ if (isLeft(decoded)) {
+ throw Error(JSON.stringify(PathReporter.report(decoded), null, 2));
+ }
+ return decoded.right;
+}
+
+export default function({ getService }: FtrProviderContext) {
+ const supertest = getService('supertest');
+ describe('pingList query', () => {
+ before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat'));
+ after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat'));
+
+ it('returns a list of pings for the given date range and default size', async () => {
+ const from = '2019-01-28T17:40:08.078Z';
+ const to = '2025-01-28T19:00:16.078Z';
+
+ const apiResponse = await supertest.get(`/api/uptime/pings?from=${from}&to=${to}&size=10`);
+
+ const { total, locations, pings } = decodePingsResponseData(apiResponse.body);
+
+ expect(total).to.be(2000);
+ expect(locations).to.eql(['mpls']);
+ expect(pings).length(10);
+ expect(pings.map(({ monitor: { id } }) => id)).to.eql([
+ '0074-up',
+ '0073-up',
+ '0099-up',
+ '0098-up',
+ '0075-intermittent',
+ '0097-up',
+ '0049-up',
+ '0047-up',
+ '0077-up',
+ '0076-up',
+ ]);
+ });
+
+ it('returns a list of pings for the date range and given size', async () => {
+ const from = '2019-01-28T17:40:08.078Z';
+ const to = '2025-01-28T19:00:16.078Z';
+ const size = 50;
+
+ const apiResponse = await supertest.get(
+ `/api/uptime/pings?from=${from}&to=${to}&size=${size}`
+ );
+
+ const { total, locations, pings } = decodePingsResponseData(apiResponse.body);
+
+ expect(total).to.be(2000);
+ expect(locations).to.eql(['mpls']);
+ expect(pings).length(50);
+ expect(pings.map(({ monitor: { id } }) => id)).to.eql([
+ '0074-up',
+ '0073-up',
+ '0099-up',
+ '0098-up',
+ '0075-intermittent',
+ '0097-up',
+ '0049-up',
+ '0047-up',
+ '0077-up',
+ '0076-up',
+ '0050-down',
+ '0048-up',
+ '0072-up',
+ '0096-up',
+ '0092-up',
+ '0069-up',
+ '0093-up',
+ '0070-down',
+ '0071-up',
+ '0095-up',
+ '0032-up',
+ '0094-up',
+ '0046-up',
+ '0091-up',
+ '0067-up',
+ '0068-up',
+ '0090-intermittent',
+ '0031-up',
+ '0066-up',
+ '0084-up',
+ '0083-up',
+ '0041-up',
+ '0045-intermittent',
+ '0042-up',
+ '0030-intermittent',
+ '0063-up',
+ '0061-up',
+ '0065-up',
+ '0062-up',
+ '0026-up',
+ '0085-up',
+ '0025-up',
+ '0088-up',
+ '0089-up',
+ '0087-up',
+ '0028-up',
+ '0086-up',
+ '0064-up',
+ '0029-up',
+ '0044-up',
+ ]);
+ });
+
+ it('returns a list of pings for a monitor ID', async () => {
+ const from = '2019-01-28T17:40:08.078Z';
+ const to = '2025-01-28T19:00:16.078Z';
+ const monitorId = '0001-up';
+ const size = 15;
+
+ const apiResponse = await supertest.get(
+ `/api/uptime/pings?from=${from}&to=${to}&monitorId=${monitorId}&size=${size}`
+ );
+
+ const { total, locations, pings } = decodePingsResponseData(apiResponse.body);
+
+ expect(total).to.be(20);
+ expect(locations).to.eql(['mpls']);
+ pings.forEach(({ monitor: { id } }) => expect(id).to.eql('0001-up'));
+ expect(pings.map(({ timestamp }) => timestamp)).to.eql([
+ '2019-09-11T03:40:34.371Z',
+ '2019-09-11T03:40:04.370Z',
+ '2019-09-11T03:39:34.370Z',
+ '2019-09-11T03:39:04.371Z',
+ '2019-09-11T03:38:34.370Z',
+ '2019-09-11T03:38:04.370Z',
+ '2019-09-11T03:37:34.370Z',
+ '2019-09-11T03:37:04.370Z',
+ '2019-09-11T03:36:34.371Z',
+ '2019-09-11T03:36:04.370Z',
+ '2019-09-11T03:35:34.373Z',
+ '2019-09-11T03:35:04.371Z',
+ '2019-09-11T03:34:34.371Z',
+ '2019-09-11T03:34:04.381Z',
+ '2019-09-11T03:33:34.371Z',
+ ]);
+ });
+
+ it('returns a list of pings sorted ascending', async () => {
+ const from = '2019-01-28T17:40:08.078Z';
+ const to = '2025-01-28T19:00:16.078Z';
+ const monitorId = '0001-up';
+ const size = 5;
+ const sort = 'asc';
+
+ const apiResponse = await supertest.get(
+ `/api/uptime/pings?from=${from}&to=${to}&monitorId=${monitorId}&size=${size}&sort=${sort}`
+ );
+
+ const { total, locations, pings } = decodePingsResponseData(apiResponse.body);
+
+ expect(total).to.be(20);
+ expect(locations).to.eql(['mpls']);
+ expect(pings.map(({ timestamp }) => timestamp)).to.eql([
+ '2019-09-11T03:31:04.380Z',
+ '2019-09-11T03:31:34.366Z',
+ '2019-09-11T03:32:04.372Z',
+ '2019-09-11T03:32:34.375Z',
+ '2019-09-11T03:33:04.370Z',
+ ]);
+ });
+ });
+}
diff --git a/x-pack/test/functional/apps/uptime/monitor.ts b/x-pack/test/functional/apps/uptime/monitor.ts
index 90ad1836c69d3..388d660f21eb3 100644
--- a/x-pack/test/functional/apps/uptime/monitor.ts
+++ b/x-pack/test/functional/apps/uptime/monitor.ts
@@ -23,8 +23,33 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await uptimeService.navigation.goToUptime();
});
- it('loads and displays uptime data based on date range', async () => {
- await uptime.loadDataAndGoToMonitorPage(dateStart, dateEnd, monitorId);
+ after(async () => {
+ await esArchiver.unload(archive);
+ });
+
+ describe('navigation to monitor page', () => {
+ before(async () => {
+ await uptime.loadDataAndGoToMonitorPage(dateStart, dateEnd, monitorId);
+ });
+
+ it('displays ping data as expected', async () => {
+ await uptime.checkPingListInteractions(
+ [
+ 'XZtoHm0B0I9WX_CznN-6',
+ '7ZtoHm0B0I9WX_CzJ96M',
+ 'pptnHm0B0I9WX_Czst5X',
+ 'I5tnHm0B0I9WX_CzPd46',
+ 'y5tmHm0B0I9WX_Czx93x',
+ 'XZtmHm0B0I9WX_CzUt3H',
+ '-JtlHm0B0I9WX_Cz3dyX',
+ 'k5tlHm0B0I9WX_CzaNxm',
+ 'NZtkHm0B0I9WX_Cz89w9',
+ 'zJtkHm0B0I9WX_CzftsN',
+ ],
+ 'mpls',
+ 'up'
+ );
+ });
});
});
};
diff --git a/x-pack/test/functional/page_objects/uptime_page.ts b/x-pack/test/functional/page_objects/uptime_page.ts
index 7157bbfb3811b..0ebcb5c87deee 100644
--- a/x-pack/test/functional/page_objects/uptime_page.ts
+++ b/x-pack/test/functional/page_objects/uptime_page.ts
@@ -9,7 +9,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
export function UptimePageProvider({ getPageObjects, getService }: FtrProviderContext) {
const pageObjects = getPageObjects(['common', 'timePicker']);
- const { common: commonService, navigation, alerts } = getService('uptime');
+ const { alerts, common: commonService, monitor, navigation } = getService('uptime');
const retry = getService('retry');
return new (class UptimePage {
@@ -137,6 +137,20 @@ export function UptimePageProvider({ getPageObjects, getService }: FtrProviderCo
return commonService.clickPageSizeSelectPopoverItem(size);
}
+ public async checkPingListInteractions(
+ timestamps: string[],
+ location?: string,
+ status?: string
+ ): Promise {
+ if (location) {
+ await monitor.setPingListLocation(location);
+ }
+ if (status) {
+ await monitor.setPingListStatus(status);
+ }
+ return monitor.checkForPingListTimestamps(timestamps);
+ }
+
public async resetFilters() {
await this.inputFilterQuery('');
await commonService.resetStatusFilter();
diff --git a/x-pack/test/functional/services/uptime/monitor.ts b/x-pack/test/functional/services/uptime/monitor.ts
index 3bdec4b6749d4..a3e3d953e2eb7 100644
--- a/x-pack/test/functional/services/uptime/monitor.ts
+++ b/x-pack/test/functional/services/uptime/monitor.ts
@@ -27,5 +27,22 @@ export function UptimeMonitorProvider({ getService }: FtrProviderContext) {
await find.descendantExistsByCssSelector('canvas.mapboxgl-canvas', mapPanel);
});
},
+ async setPingListLocation(location: string) {
+ await testSubjects.click('xpack.uptime.pingList.locationSelect', 5000);
+ return testSubjects.click(`xpack.uptime.pingList.locationOptions.${location}`, 5000);
+ },
+ async setPingListStatus(status: string) {
+ await testSubjects.click('xpack.uptime.pingList.statusSelect', 5000);
+ return testSubjects.click(`xpack.uptime.pingList.statusOptions.${status}`, 5000);
+ },
+ async checkForPingListTimestamps(timestamps: string[]): Promise {
+ return retry.tryForTime(10000, async () => {
+ await Promise.all(
+ timestamps.map(timestamp =>
+ testSubjects.existOrFail(`xpack.uptime.pingList.ping-${timestamp}`)
+ )
+ );
+ });
+ },
};
}