[Uptime] Fix snapshot query to handle large numbers of monitors (#30441) (#30752)

* Refactor snapshot histogram ES query and subsequent processing.

* Fix issues on client, remove obsolete code, update tests.

* Get type check passing and update Snapshot component's unit tests to work with new schema data.
This commit is contained in:
Justin Kambic 2019-02-14 12:54:32 -05:00 committed by GitHub
parent 9c5d95ecd7
commit c6106337dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 479 additions and 2270 deletions

View file

@ -1719,47 +1719,16 @@
"description": "",
"args": [],
"type": {
"kind": "LIST",
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "NON_NULL",
"kind": "LIST",
"name": null,
"ofType": { "kind": "OBJECT", "name": "HistogramSeries", "ofType": null }
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "HistogramSeries",
"description": "",
"fields": [
{
"name": "monitorId",
"description": "",
"args": [],
"type": { "kind": "SCALAR", "name": "String", "ofType": null },
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "data",
"description": "",
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": { "kind": "OBJECT", "name": "HistogramDataPoint", "ofType": null }
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": { "kind": "OBJECT", "name": "HistogramDataPoint", "ofType": null }
}
}
},
"isDeprecated": false,

View file

@ -337,13 +337,7 @@ export interface Snapshot {
total?: number | null;
histogram?: HistogramSeries[] | null;
}
export interface HistogramSeries {
monitorId?: string | null;
data?: HistogramDataPoint[] | null;
histogram: HistogramDataPoint[];
}
export interface HistogramDataPoint {

View file

@ -137,894 +137,81 @@ exports[`Snapshot component renders without errors 1`] = `
histogram={
Array [
Object {
"data": Array [
Object {
"downCount": 293,
"upCount": 1,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"downCount": 300,
"upCount": null,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"downCount": 155,
"upCount": 145,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 300,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 300,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 300,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 300,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 300,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 300,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 300,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 300,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 77,
"x": 1548701220000,
"x0": 1548700920000,
"y": 1,
},
],
"monitorId": "auto-tcp-0X81440A68E839814C",
"downCount": 3,
"upCount": 7,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"data": Array [
Object {
"downCount": null,
"upCount": 79,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 80,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 86,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"downCount": 1,
"upCount": 87,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 81,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 100,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 100,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 99,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 96,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 81,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 80,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 20,
"x": 1548701220000,
"x0": 1548700920000,
"y": 1,
},
],
"monitorId": "auto-http-0XD9AE729FC1C1E04A",
"downCount": 3,
"upCount": 7,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"data": Array [
Object {
"downCount": null,
"upCount": 79,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 80,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 86,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 88,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 81,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 95,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 94,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 98,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 93,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 81,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 80,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 20,
"x": 1548701220000,
"x0": 1548700920000,
"y": 1,
},
],
"monitorId": "auto-http-0XDD2D4E60FD4A61C3",
"downCount": 3,
"upCount": 7,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"data": Array [
Object {
"downCount": null,
"upCount": 74,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 75,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 75,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 73,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 75,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 74,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 75,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 75,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 75,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 75,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 75,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 19,
"x": 1548701220000,
"x0": 1548700920000,
"y": 1,
},
],
"monitorId": "auto-http-0X131221E73F825974",
"downCount": 3,
"upCount": 7,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"data": Array [
Object {
"downCount": 74,
"upCount": null,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"downCount": 75,
"upCount": null,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"downCount": 75,
"upCount": null,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"downCount": 75,
"upCount": null,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"downCount": 75,
"upCount": null,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"downCount": 75,
"upCount": null,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"downCount": 75,
"upCount": null,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"downCount": 75,
"upCount": null,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"downCount": 75,
"upCount": null,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"downCount": 75,
"upCount": null,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": 75,
"upCount": null,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
Object {
"downCount": 19,
"upCount": null,
"x": 1548701220000,
"x0": 1548700920000,
"y": 1,
},
],
"monitorId": "auto-http-0X3675F89EF0612091",
"downCount": 2,
"upCount": 8,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"data": Array [
Object {
"downCount": null,
"upCount": 69,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 70,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 68,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 69,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 69,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 69,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 70,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 70,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 70,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 69,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 70,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 18,
"x": 1548701220000,
"x0": 1548700920000,
"y": 1,
},
],
"monitorId": "auto-http-0X9CB71300ABD5A2A8",
"downCount": 2,
"upCount": 8,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"data": Array [
Object {
"downCount": null,
"upCount": 58,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 60,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 60,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 60,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 60,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 60,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 60,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 60,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 60,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 60,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 60,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 16,
"x": 1548701220000,
"x0": 1548700920000,
"y": 1,
},
],
"monitorId": "auto-http-0X970CBD2F2102BFA8",
"downCount": 2,
"upCount": 8,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"data": Array [
Object {
"downCount": 57,
"upCount": null,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"downCount": 60,
"upCount": null,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"downCount": 61,
"upCount": null,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"downCount": 56,
"upCount": null,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"downCount": 45,
"upCount": null,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"downCount": 49,
"upCount": null,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"downCount": 60,
"upCount": null,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"downCount": 60,
"upCount": null,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"downCount": 64,
"upCount": null,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"downCount": 59,
"upCount": null,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": 60,
"upCount": null,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
Object {
"downCount": 14,
"upCount": null,
"x": 1548701220000,
"x0": 1548700920000,
"y": 1,
},
],
"monitorId": "auto-http-0XA8096548ECEB85B7",
"downCount": 2,
"upCount": 8,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"data": Array [
Object {
"downCount": null,
"upCount": 5,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 1,
"x": 1548701220000,
"x0": 1548700920000,
"y": 1,
},
],
"monitorId": "auto-http-0XC9CDA429418EDC2B",
"downCount": 2,
"upCount": 8,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"data": Array [
Object {
"downCount": null,
"upCount": 5,
"x": 1548697920000,
"x0": 1548697620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548698220000,
"x0": 1548697920000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548698520000,
"x0": 1548698220000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548698820000,
"x0": 1548698520000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548699120000,
"x0": 1548698820000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548699420000,
"x0": 1548699120000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548699720000,
"x0": 1548699420000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548700020000,
"x0": 1548699720000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548700320000,
"x0": 1548700020000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 5,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
Object {
"downCount": null,
"upCount": 1,
"x": 1548701220000,
"x0": 1548700920000,
"y": 1,
},
],
"monitorId": "auto-http-0XE3B163481423197D",
"downCount": 2,
"upCount": 8,
"x": 1548700620000,
"x0": 1548700320000,
"y": 1,
},
Object {
"downCount": 2,
"upCount": 8,
"x": 1548700920000,
"x0": 1548700620000,
"y": 1,
},
]
}

View file

@ -12,6 +12,21 @@ exports[`SnapshotHistogram component renders the component without errors 1`] =
color="#FEFEFE"
data={
Array [
Object {
"x": 1548697920000,
"x0": 1548697620000,
"y": 7,
},
Object {
"x": 1548698220000,
"x0": 1548697920000,
"y": 7,
},
Object {
"x": 1548698520000,
"x0": 1548698220000,
"y": 7,
},
Object {
"x": 1548698820000,
"x0": 1548698520000,
@ -52,26 +67,6 @@ exports[`SnapshotHistogram component renders the component without errors 1`] =
"x0": 1548700620000,
"y": 8,
},
Object {
"x": 1548701220000,
"x0": 1548700920000,
"y": 8,
},
Object {
"x": 1548697920000,
"x0": 1548697620000,
"y": 7,
},
Object {
"x": 1548698220000,
"x0": 1548697920000,
"y": 7,
},
Object {
"x": 1548698520000,
"x0": 1548698220000,
"y": 7,
},
]
}
name="Up"
@ -135,11 +130,6 @@ exports[`SnapshotHistogram component renders the component without errors 1`] =
"x0": 1548700620000,
"y": 2,
},
Object {
"x": 1548701220000,
"x0": 1548700920000,
"y": 2,
},
]
}
name="Down"

View file

@ -6,191 +6,30 @@
import React from 'react';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { Snapshot as SnapshotType } from '../../../../common/graphql/types';
import { Snapshot } from '../snapshot';
describe('Snapshot component', () => {
const data = {
snapshot: {
up: 8,
down: 2,
total: 10,
histogram: [
{
monitorId: 'auto-tcp-0X81440A68E839814C',
data: [
{ upCount: 1, downCount: 293, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: null, downCount: 300, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 145, downCount: 155, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 300, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 300, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 300, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 300, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 300, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 300, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 300, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 300, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 77, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0XD9AE729FC1C1E04A',
data: [
{ upCount: 79, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 80, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 86, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 87, downCount: 1, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 81, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 100, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 100, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 99, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 96, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 81, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 80, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 20, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0XDD2D4E60FD4A61C3',
data: [
{ upCount: 79, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 80, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 86, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 88, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 81, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 95, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 94, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 98, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 93, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 81, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 80, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 20, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0X131221E73F825974',
data: [
{ upCount: 74, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 75, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 75, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 73, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 75, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 74, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 75, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 75, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 75, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 75, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 75, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 19, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0X3675F89EF0612091',
data: [
{ upCount: null, downCount: 74, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: null, downCount: 75, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: null, downCount: 75, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: null, downCount: 75, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: null, downCount: 75, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: null, downCount: 75, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: null, downCount: 75, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: null, downCount: 75, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: null, downCount: 75, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: null, downCount: 75, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: null, downCount: 75, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: null, downCount: 19, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0X9CB71300ABD5A2A8',
data: [
{ upCount: 69, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 70, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 68, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 69, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 69, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 69, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 70, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 70, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 70, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 69, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 70, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 18, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0X970CBD2F2102BFA8',
data: [
{ upCount: 58, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 60, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 60, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 60, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 60, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 60, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 60, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 60, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 60, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 60, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 60, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 16, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0XA8096548ECEB85B7',
data: [
{ upCount: null, downCount: 57, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: null, downCount: 60, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: null, downCount: 61, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: null, downCount: 56, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: null, downCount: 45, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: null, downCount: 49, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: null, downCount: 60, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: null, downCount: 60, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: null, downCount: 64, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: null, downCount: 59, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: null, downCount: 60, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: null, downCount: 14, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0XC9CDA429418EDC2B',
data: [
{ upCount: 5, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 1, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0XE3B163481423197D',
data: [
{ upCount: 5, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 1, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
],
},
const snapshot: SnapshotType = {
up: 8,
down: 2,
total: 10,
histogram: [
{ upCount: 7, downCount: 3, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 7, downCount: 3, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 7, downCount: 3, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 7, downCount: 3, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548700920000, x0: 1548700620000, y: 1 },
],
};
it('renders without errors', () => {
const { snapshot } = data;
const wrapper = shallowWithIntl(
<Snapshot
dangerColor="#F050F0"

View file

@ -6,184 +6,25 @@
import React from 'react';
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
import { SnapshotHistogram } from '../snapshot_histogram';
import { SnapshotHistogram, SnapshotHistogramProps } from '../snapshot_histogram';
describe('SnapshotHistogram component', () => {
const props = {
const props: SnapshotHistogramProps = {
primaryColor: '#FEFEFE',
dangerColor: '#FF00FF',
windowWidth: 1200,
histogram: [
{
monitorId: 'auto-tcp-0X81440A68E839814C',
data: [
{ upCount: 1, downCount: 293, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: null, downCount: 300, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 145, downCount: 155, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 300, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 300, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 300, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 300, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 300, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 300, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 300, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 300, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 77, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0XD9AE729FC1C1E04A',
data: [
{ upCount: 79, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 80, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 86, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 87, downCount: 1, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 81, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 100, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 100, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 99, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 96, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 81, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 80, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 20, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0XDD2D4E60FD4A61C3',
data: [
{ upCount: 79, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 80, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 86, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 88, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 81, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 95, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 94, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 98, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 93, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 81, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 80, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 20, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0X131221E73F825974',
data: [
{ upCount: 74, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 75, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 75, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 73, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 75, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 74, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 75, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 75, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 75, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 75, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 75, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 19, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0X3675F89EF0612091',
data: [
{ upCount: null, downCount: 74, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: null, downCount: 75, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: null, downCount: 75, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: null, downCount: 75, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: null, downCount: 75, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: null, downCount: 75, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: null, downCount: 75, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: null, downCount: 75, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: null, downCount: 75, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: null, downCount: 75, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: null, downCount: 75, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: null, downCount: 19, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0X9CB71300ABD5A2A8',
data: [
{ upCount: 69, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 70, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 68, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 69, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 69, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 69, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 70, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 70, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 70, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 69, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 70, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 18, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0X970CBD2F2102BFA8',
data: [
{ upCount: 58, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 60, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 60, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 60, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 60, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 60, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 60, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 60, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 60, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 60, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 60, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 16, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0XA8096548ECEB85B7',
data: [
{ upCount: null, downCount: 57, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: null, downCount: 60, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: null, downCount: 61, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: null, downCount: 56, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: null, downCount: 45, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: null, downCount: 49, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: null, downCount: 60, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: null, downCount: 60, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: null, downCount: 64, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: null, downCount: 59, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: null, downCount: 60, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: null, downCount: 14, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0XC9CDA429418EDC2B',
data: [
{ upCount: 5, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 1, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{
monitorId: 'auto-http-0XE3B163481423197D',
data: [
{ upCount: 5, downCount: null, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 5, downCount: null, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 5, downCount: null, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 5, downCount: null, x: 1548700920000, x0: 1548700620000, y: 1 },
{ upCount: 1, downCount: null, x: 1548701220000, x0: 1548700920000, y: 1 },
],
},
{ upCount: 7, downCount: 3, x: 1548697920000, x0: 1548697620000, y: 1 },
{ upCount: 7, downCount: 3, x: 1548698220000, x0: 1548697920000, y: 1 },
{ upCount: 7, downCount: 3, x: 1548698520000, x0: 1548698220000, y: 1 },
{ upCount: 7, downCount: 3, x: 1548698820000, x0: 1548698520000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548699120000, x0: 1548698820000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548699420000, x0: 1548699120000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548699720000, x0: 1548699420000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548700020000, x0: 1548699720000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548700320000, x0: 1548700020000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548700620000, x0: 1548700320000, y: 1 },
{ upCount: 8, downCount: 2, x: 1548700920000, x0: 1548700620000, y: 1 },
],
};

View file

@ -8,14 +8,13 @@
import { EuiHistogramSeries, EuiSeriesChart, EuiSeriesChartUtils } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
import { HistogramSeries } from '../../../common/graphql/types';
import { formatHistogramData } from '../../lib/adapters/monitors/format_histogram_data';
import { HistogramDataPoint } from '../../../common/graphql/types';
interface SnapshotHistogramProps {
export interface SnapshotHistogramProps {
windowWidth: number;
primaryColor: string;
dangerColor: string;
histogram: HistogramSeries[];
histogram: HistogramDataPoint[];
}
/**
@ -30,31 +29,27 @@ export const SnapshotHistogram = ({
histogram,
primaryColor,
windowWidth,
}: SnapshotHistogramProps) => {
const { upSeriesData, downSeriesData } = formatHistogramData(histogram);
return (
<EuiSeriesChart
width={windowWidth * windowRatio}
height={120}
stackBy="y"
xType={EuiSeriesChartUtils.SCALE.TIME}
xCrosshairFormat="YYYY-MM-DD hh:mmZ"
>
<EuiHistogramSeries
data={upSeriesData}
name={i18n.translate('xpack.uptime.snapshotHistogram.series.upLabel', {
defaultMessage: 'Up',
})}
color={primaryColor}
/>
<EuiHistogramSeries
data={downSeriesData}
name={i18n.translate('xpack.uptime.snapshotHistogram.series.downLabel', {
defaultMessage: 'Down',
})}
color={dangerColor}
/>
</EuiSeriesChart>
);
};
}: SnapshotHistogramProps) => (
<EuiSeriesChart
width={windowWidth * windowRatio}
height={120}
stackBy="y"
xType={EuiSeriesChartUtils.SCALE.TIME}
xCrosshairFormat="YYYY-MM-DD hh:mmZ"
>
<EuiHistogramSeries
data={histogram.map(({ x, x0, upCount }) => ({ x, x0, y: upCount }))}
name={i18n.translate('xpack.uptime.snapshotHistogram.series.upLabel', {
defaultMessage: 'Up',
})}
color={primaryColor}
/>
<EuiHistogramSeries
data={histogram.map(({ x, x0, downCount }) => ({ x, x0, y: downCount }))}
name={i18n.translate('xpack.uptime.snapshotHistogram.series.downLabel', {
defaultMessage: 'Down',
})}
color={dangerColor}
/>
</EuiSeriesChart>
);

View file

@ -12,23 +12,20 @@ query Snapshot(
$dateRangeEnd: String!
$filters: String
) {
snapshot: getSnapshot(
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
filters: $filters
) {
up
down
total
histogram {
monitorId
data {
upCount
downCount
x
x0
y
}
snapshot: getSnapshot(
dateRangeStart: $dateRangeStart
dateRangeEnd: $dateRangeEnd
filters: $filters
) {
up
down
total
histogram {
upCount
downCount
x
x0
y
}
}
}

View file

@ -7,6 +7,7 @@
import { i18n } from '@kbn/i18n';
import React from 'react';
import { Query } from 'react-apollo';
import { Snapshot as SnapshotType } from '../../../../common/graphql/types';
import { UptimeCommonProps } from '../../../uptime_app';
import { Snapshot, SnapshotLoading } from '../../functional';
import { getSnapshotQuery } from './get_snapshot';
@ -63,7 +64,7 @@ export class SnapshotQuery extends React.Component<Props, SnapshotQueryState> {
defaultMessage: 'Error {message}',
});
}
const { snapshot } = data;
const { snapshot }: { snapshot: SnapshotType } = data;
return (
<Snapshot

View file

@ -1,137 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`formatHistogramData adds to existing down count 1`] = `
Object {
"downSeriesData": Array [
Object {
"x": 10,
"x0": 11,
"y": 2,
},
Object {
"x": 11,
"x0": 12,
"y": 2,
},
Object {
"x": 12,
"x0": 13,
"y": 1,
},
],
"upSeriesData": Array [
Object {
"x": 10,
"x0": 11,
"y": 1,
},
Object {
"x": 11,
"x0": 12,
"y": 1,
},
Object {
"x": 12,
"x0": 13,
"y": 2,
},
],
}
`;
exports[`formatHistogramData adds to existing up count 1`] = `
Object {
"downSeriesData": Array [
Object {
"x": 10,
"x0": 11,
"y": 1,
},
Object {
"x": 11,
"x0": 12,
"y": 1,
},
],
"upSeriesData": Array [
Object {
"x": 10,
"x0": 11,
"y": 1,
},
Object {
"x": 11,
"x0": 12,
"y": 1,
},
Object {
"x": 12,
"x0": 13,
"y": 2,
},
],
}
`;
exports[`formatHistogramData doesn't add an entry to either count when none exists 1`] = `
Object {
"downSeriesData": Array [
Object {
"x": 10,
"x0": 11,
"y": 2,
},
Object {
"x": 11,
"x0": 12,
"y": 1,
},
Object {
"x": 12,
"x0": 13,
"y": 1,
},
],
"upSeriesData": Array [
Object {
"x": 10,
"x0": 11,
"y": 1,
},
Object {
"x": 11,
"x0": 12,
"y": 1,
},
Object {
"x": 12,
"x0": 13,
"y": 2,
},
],
}
`;
exports[`formatHistogramData filters out null data sets 1`] = `
Object {
"downSeriesData": Array [
Object {
"x": 10,
"x0": 11,
"y": 1,
},
Object {
"x": 11,
"x0": 12,
"y": 1,
},
],
"upSeriesData": Array [
Object {
"x": 12,
"x0": 13,
"y": 1,
},
],
}
`;

View file

@ -1,279 +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 { HistogramSeries } from 'x-pack/plugins/uptime/common/graphql/types';
import { formatHistogramData } from '../format_histogram_data';
describe('formatHistogramData', () => {
it('returns an empty arrays when no data is provided', () => {
const result = formatHistogramData([]);
expect(result).toEqual({ downSeriesData: [], upSeriesData: [] });
});
it('filters out null data sets', () => {
const seriesList: HistogramSeries[] = [
{
monitorId: 'monitor1',
data: null,
},
{
monitorId: 'monitor2',
data: [
{
upCount: null,
downCount: 2,
x: 10,
x0: 11,
y: 4,
},
{
upCount: null,
downCount: 2,
x: 11,
x0: 12,
y: 4,
},
{
upCount: 4,
downCount: null,
x: 12,
x0: 13,
y: 4,
},
],
},
];
const result = formatHistogramData(seriesList);
expect(result).toMatchSnapshot();
});
it('adds to existing up count', () => {
const seriesList: HistogramSeries[] = [
{
monitorId: 'monitor1',
data: [
{
upCount: 3,
downCount: null,
x: 10,
x0: 11,
y: 4,
},
{
upCount: 3,
downCount: null,
x: 11,
x0: 12,
y: 4,
},
{
upCount: 3,
downCount: null,
x: 12,
x0: 13,
y: 4,
},
],
},
{
monitorId: 'monitor2',
data: [
{
upCount: null,
downCount: 2,
x: 10,
x0: 11,
y: 4,
},
{
upCount: null,
downCount: 2,
x: 11,
x0: 12,
y: 4,
},
{
upCount: 4,
downCount: null,
x: 12,
x0: 13,
y: 4,
},
],
},
];
const result = formatHistogramData(seriesList);
expect(result).toMatchSnapshot();
});
it('adds to existing down count', () => {
const seriesList: HistogramSeries[] = [
{
monitorId: 'monitor1',
data: [
{
upCount: 3,
downCount: null,
x: 10,
x0: 11,
y: 4,
},
{
upCount: 3,
downCount: null,
x: 11,
x0: 12,
y: 4,
},
{
upCount: 3,
downCount: null,
x: 12,
x0: 13,
y: 4,
},
],
},
{
monitorId: 'monitor2',
data: [
{
upCount: null,
downCount: 2,
x: 10,
x0: 11,
y: 4,
},
{
upCount: null,
downCount: 2,
x: 11,
x0: 12,
y: 4,
},
{
upCount: 4,
downCount: null,
x: 12,
x0: 13,
y: 4,
},
],
},
{
monitorId: 'monitor3',
data: [
{
upCount: null,
downCount: 24,
x: 10,
x0: 11,
y: 4,
},
{
upCount: null,
downCount: 23,
x: 11,
x0: 12,
y: 4,
},
{
upCount: null,
downCount: 35,
x: 12,
x0: 13,
y: 4,
},
],
},
];
const result = formatHistogramData(seriesList);
expect(result).toMatchSnapshot();
});
it(`doesn't add an entry to either count when none exists`, () => {
const seriesList: HistogramSeries[] = [
{
monitorId: 'monitor1',
data: [
{
upCount: 3,
downCount: null,
x: 10,
x0: 11,
y: 4,
},
{
upCount: 3,
downCount: null,
x: 11,
x0: 12,
y: 4,
},
{
upCount: 3,
downCount: null,
x: 12,
x0: 13,
y: 4,
},
],
},
{
monitorId: 'monitor2',
data: [
{
upCount: null,
downCount: 2,
x: 10,
x0: 11,
y: 4,
},
{
upCount: null,
downCount: 2,
x: 11,
x0: 12,
y: 4,
},
{
upCount: 4,
downCount: null,
x: 12,
x0: 13,
y: 4,
},
],
},
{
monitorId: 'monitor3',
data: [
{
upCount: null,
downCount: 24,
x: 10,
x0: 11,
y: 4,
},
{
upCount: null,
downCount: null,
x: 11,
x0: 12,
y: 4,
},
{
upCount: null,
downCount: 35,
x: 12,
x0: 13,
y: 4,
},
],
},
];
const result = formatHistogramData(seriesList);
expect(result).toMatchSnapshot();
});
});

View file

@ -1,53 +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 { HistogramDataPoint, HistogramSeries } from '../../../../common/graphql/types';
interface FormattedHistogramData {
upSeriesData: HistogramDataPoint[];
downSeriesData: HistogramDataPoint[];
}
/**
* This function reduces a series of monitors' histograms into a singular
* series, which is then displayed as a unified snapshot of the performance
* of all the monitors over time.
* @param histograms The series data for the provided monitors
*/
export const formatHistogramData = (histograms: HistogramSeries[]): FormattedHistogramData => {
return histograms
.map(({ data }) => data)
.filter(series => series !== null && series !== undefined)
.reduce(
(accumulatedData: FormattedHistogramData, data) => {
// `data` will not be null/undefined because those elements are filtered
data!.forEach(dataPoint => {
const { x, x0, downCount, upCount } = dataPoint;
const findPointInSeries = (hdp: HistogramDataPoint) => hdp.x === x && hdp.x0 === x0;
const upEntry = accumulatedData.upSeriesData.find(findPointInSeries);
const downEntry = accumulatedData.downSeriesData.find(findPointInSeries);
if (downCount) {
if (downEntry) {
downEntry.y += 1;
} else {
accumulatedData.downSeriesData.push({ x, x0, y: 1 });
}
} else if (upCount) {
if (upEntry) {
upEntry.y += 1;
} else {
accumulatedData.upSeriesData.push({ x, x0, y: 1 });
}
}
});
return accumulatedData;
},
{
upSeriesData: [],
downSeriesData: [],
}
);
};

View file

@ -23,16 +23,11 @@ export const monitorsSchema = gql`
y: UnsignedInteger
}
type HistogramSeries {
monitorId: String
data: [HistogramDataPoint!]
}
type Snapshot {
up: Int
down: Int
total: Int
histogram: [HistogramSeries!]
histogram: [HistogramDataPoint!]!
}
type DataPoint {

View file

@ -4,6 +4,28 @@
* you may not use this file except in compliance with the Elastic License.
*/
export interface HistogramQueryResult {
key: number;
doc_count: number;
bucket_total: {
value: number;
};
down: {
bucket_count: {
value: number;
};
};
}
export interface UMESBucket {
key: number;
}
export interface UMESHistogramBucket {
x: number;
x0: number;
}
export interface DatabaseAdapter {
count(request: any, params: any): Promise<any>;
search(request: any, params: any): Promise<any>;

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { DocCount, HistogramSeries, Ping, PingResults } from '../../../../common/graphql/types';
import { DocCount, HistogramDataPoint, Ping, PingResults } from '../../../../common/graphql/types';
export interface UMPingsAdapter {
getAll(
@ -29,7 +29,7 @@ export interface UMPingsAdapter {
dateRangeStart: string,
dateRangeEnd: string,
filters?: string | null
): Promise<HistogramSeries[] | null>;
): Promise<HistogramDataPoint[]>;
getDocCount(request: any): Promise<DocCount>;
}

View file

@ -7,9 +7,10 @@
import { get } from 'lodash';
import moment from 'moment';
import { INDEX_NAMES } from '../../../../common/constants';
import { DocCount, HistogramSeries, Ping, PingResults } from '../../../../common/graphql/types';
import { getFilteredQueryAndStatusFilter } from '../../helper';
import { DatabaseAdapter } from '../database';
import { DocCount, HistogramDataPoint, Ping, PingResults } from '../../../../common/graphql/types';
import { formatEsBucketsForHistogram } from '../../helper';
import { getFilterFromMust } from '../../helper/get_filter_from_must';
import { DatabaseAdapter, HistogramQueryResult } from '../database';
import { UMPingsAdapter } from './adapter_types';
export class ElasticsearchPingsAdapter implements UMPingsAdapter {
@ -163,12 +164,8 @@ export class ElasticsearchPingsAdapter implements UMPingsAdapter {
dateRangeStart: string,
dateRangeEnd: string,
filters?: string | null
): Promise<HistogramSeries[] | null> {
const { statusFilter, query } = getFilteredQueryAndStatusFilter(
dateRangeStart,
dateRangeEnd,
filters
);
): Promise<HistogramDataPoint[]> {
const query = getFilterFromMust(dateRangeStart, dateRangeEnd, filters);
const params = {
index: INDEX_NAMES.HEARTBEAT,
body: {
@ -181,36 +178,24 @@ export class ElasticsearchPingsAdapter implements UMPingsAdapter {
buckets: 25,
},
aggs: {
by_id: {
terms: {
field: 'monitor.id',
size: 200,
down: {
filter: {
term: {
'monitor.status': 'down',
},
},
aggs: {
status: {
terms: {
field: 'monitor.status',
size: 2,
bucket_count: {
cardinality: {
field: 'monitor.id',
},
},
},
},
},
},
current_status: {
terms: {
field: 'monitor.id',
size: 200,
},
aggs: {
latest: {
top_hits: {
size: 1,
sort: [
{
'@timestamp': 'desc',
},
],
bucket_total: {
cardinality: {
field: 'monitor.id',
precision_threshold: 20000,
},
},
},
@ -219,83 +204,21 @@ export class ElasticsearchPingsAdapter implements UMPingsAdapter {
},
};
/**
* The following code associates a monitor's ID with the data that will
* be displayed along with its histogram. The histogram components we're using
* require data to be formatted beyond simply an x/y shape; instead we need
* a definition of space to occupy on the x axis for each data point, defined as
* "x" and "x0".
*
* Each data point is assigned to a key/value pair, where the key is the monitor's
* ID, and the value is a list of data points associated with its up or down status.
*/
const histogramList: HistogramSeries[] = [];
// This function adds a processed data point to the histogram series for the appropriate monitor ID
// Because we aren't applying filters to our top_hits result in the above query, we drop anything
// that doesn't conform to the filter, if it's defined. If an entry already exists in our list, we
// add the given data point to it, otherwise we create a new entry.
const updateHistogramSeries = (key: string, value: object) => {
const status = get(
currentStatus.find(h => h.key === key),
'latest.hits.hits[0]._source.monitor.status',
null
);
if (!statusFilter || (statusFilter && status === statusFilter)) {
const histogramEntry = histogramList.find(
(entry: HistogramSeries) => entry.monitorId === key
);
if (histogramEntry && histogramEntry.data) {
histogramEntry.data.push(value);
} else {
histogramList.push({ monitorId: key, data: [value] });
}
}
};
const result = await this.database.search(request, params);
const buckets: any[] = get(result, 'aggregations.timeseries.buckets', []);
const currentStatus: any[] = get(result, 'aggregations.current_status.buckets', []);
// null is allowed for this type
if (buckets.length === 0) {
return null;
}
/**
* In the below loop, we iterate each monitor.id term, and within iterate
* over the data result from our auto_histogram agg, and append those data
* to the series collection we will return to the client.
*/
const defaultBucketSize = Math.abs(buckets[0].key - buckets[1].key);
buckets.forEach((bucket: any, index: number, array: any[]) => {
const nextPoint = array[index + 1];
let bucketSize = 0;
if (nextPoint) {
bucketSize = Math.abs(nextPoint.key - bucket.key);
} else {
bucketSize = defaultBucketSize;
}
const { buckets: idBuckets } = bucket.by_id;
idBuckets.forEach(
({ key: monitorId, status }: { key: string; status: { buckets: any[] } }) => {
let upCount = null;
let downCount = null;
status.buckets.forEach(({ key, doc_count }: { key: string; doc_count: number }) => {
if (key === 'up') {
upCount = doc_count;
} else if (key === 'down') {
downCount = doc_count;
}
});
updateHistogramSeries(monitorId, {
upCount,
downCount,
x: bucket.key + bucketSize,
x0: bucket.key,
y: 1,
});
}
);
const buckets: HistogramQueryResult[] = get(result, 'aggregations.timeseries.buckets', []);
const mappedBuckets = buckets.map(bucket => {
const key: number = get(bucket, 'key');
const total: number = get(bucket, 'bucket_total.value');
const downCount: number = get(bucket, 'down.bucket_count.value');
return {
key,
downCount,
upCount: total - downCount,
y: 1,
};
});
return histogramList;
return formatEsBucketsForHistogram(mappedBuckets);
}
/**

View file

@ -5,7 +5,7 @@
*/
import { take } from 'lodash';
import { DocCount, HistogramSeries, Ping, PingResults } from '../../../../common/graphql/types';
import { DocCount, HistogramDataPoint, Ping, PingResults } from '../../../../common/graphql/types';
import { UMPingsAdapter } from './adapter_types';
const sortPings = (sort: string) =>
@ -57,7 +57,7 @@ export class MemoryPingsAdapter implements UMPingsAdapter {
dateRangeStart: string,
dateRangeEnd: string,
filters?: string | null | undefined
): Promise<HistogramSeries[] | null> {
): Promise<HistogramDataPoint[]> {
throw new Error('Method not implemented.');
}

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { DocCount, HistogramSeries, Ping, PingResults } from '../../../common/graphql/types';
import { DocCount, HistogramDataPoint, Ping, PingResults } from '../../../common/graphql/types';
import { UMPingsAdapter } from '../adapters/pings';
export class UMPingsDomain {
@ -46,7 +46,7 @@ export class UMPingsDomain {
dateRangeStart: string,
dateRangeEnd: string,
filters?: string | null
): Promise<HistogramSeries[] | null> {
): Promise<HistogramDataPoint[]> {
return this.adapter.getPingHistogram(request, dateRangeStart, dateRangeEnd, filters);
}

View file

@ -0,0 +1,42 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`formatEsBucketsForHistogram returns properly formatted buckets 1`] = `
Array [
Object {
"key": 1000,
"x": 2000,
"x0": 1000,
},
Object {
"key": 2000,
"x": 3000,
"x0": 2000,
},
Object {
"key": 3000,
"x": 4000,
"x0": 3000,
},
]
`;
exports[`formatEsBucketsForHistogram returns properly formatted object for generic call 1`] = `
Array [
Object {
"key": 1000,
"name": "something",
"value": 150,
"x": 2000,
"x0": 1000,
},
Object {
"key": 2000,
"name": "something",
"value": 120,
"x": 3000,
"x0": 2000,
},
]
`;
exports[`formatEsBucketsForHistogram returns the provided buckets if length is below min threshold 1`] = `Array []`;

View file

@ -0,0 +1,60 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`getFilterFromMust applies date range only for undefined filter string 1`] = `
Object {
"bool": Object {
"filter": Array [
Object {
"range": Object {
"@timestamp": Object {
"gte": "start range",
"lte": "end range",
},
},
},
],
},
}
`;
exports[`getFilterFromMust applies date range only for undefined filter string 2`] = `
Object {
"bool": Object {
"filter": Array [
Object {
"range": Object {
"@timestamp": Object {
"gte": "start range",
"lte": "end range",
},
},
},
],
},
}
`;
exports[`getFilterFromMust applies filter clauses to output object 1`] = `
Object {
"bool": Object {
"filter": Array [
Object {
"range": Object {
"@timestamp": Object {
"gte": "start range",
"lte": "end range",
},
},
},
Object {
"match": Object {
"monitor.status": Object {
"operator": "and",
"query": "up",
},
},
},
],
},
}
`;

View file

@ -0,0 +1,29 @@
/*
* 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 { formatEsBucketsForHistogram } from '../format_es_buckets_for_histogram';
describe('formatEsBucketsForHistogram', () => {
it('returns the provided buckets if length is below min threshold', () => {
const buckets = [{ key: 1000 }];
const result = formatEsBucketsForHistogram(buckets);
expect(result).toMatchSnapshot();
});
it('returns properly formatted buckets', () => {
const buckets = [{ key: 1000 }, { key: 2000 }, { key: 3000 }, { key: 4000 }];
const result = formatEsBucketsForHistogram(buckets);
expect(result).toMatchSnapshot();
});
it('returns properly formatted object for generic call', () => {
const buckets = [
{ key: 1000, name: 'something', value: 150 },
{ key: 2000, name: 'something', value: 120 },
{ key: 3000, name: 'something', value: 180 },
];
const result = formatEsBucketsForHistogram(buckets);
expect(result).toMatchSnapshot();
});
});

View file

@ -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 { getFilterFromMust } from '../get_filter_from_must';
describe('getFilterFromMust', () => {
it('applies date range only for undefined filter string', () => {
const result = getFilterFromMust('start range', 'end range');
expect(result).toMatchSnapshot();
});
it('applies date range only for undefined filter string', () => {
const result = getFilterFromMust('start range', 'end range');
expect(result).toMatchSnapshot();
});
it('applies filter clauses to output object', () => {
const result = getFilterFromMust(
'start range',
'end range',
'{"bool":{"must":[{"match":{"monitor.status":{"query":"up","operator":"and"}}}]}}'
);
expect(result).toMatchSnapshot();
});
});

View file

@ -0,0 +1,44 @@
/*
* 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 { UMESBucket, UMESHistogramBucket } from '../adapters/database';
/**
* The charting library we're currently using requires histogram data points have an
* x and an x0 property, where x0 is the beginning of a data point and x provides
* the size of the point from the start. This function attempts to generalize the
* concept so any bucket that has a numeric value as its key can be put into this format.
*
* Additionally, histograms that stack horizontally instead of vertically need to have
* a y and a y0 value. We're not doing this currently but with some minor modification
* this function could provide formatting for those buckets as well.
* @param buckets The ES data to format.
*/
export function formatEsBucketsForHistogram<T extends UMESBucket>(
buckets: T[]
): Array<T & UMESHistogramBucket> {
// wait for first bucket to fill up
if (buckets.length < 2) {
return [];
}
const TERMINAL_INDEX = buckets.length - 1;
const { key: terminalBucketTime } = buckets[TERMINAL_INDEX];
// drop the most recent bucket to avoid returning incomplete bucket
return buckets.slice(0, TERMINAL_INDEX).map((item, index, array) => {
const { key } = item;
const nextItem = array[index + 1];
const bucketSize = nextItem ? Math.abs(nextItem.key - key) : Math.abs(terminalBucketTime - key);
return Object.assign(
{},
{
x: key + bucketSize,
x0: key,
},
item
);
});
}

View file

@ -0,0 +1,29 @@
/*
* 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.
*/
/**
* Will convert the filter object supplied by the client
* to use a filter rather than a must clause.
* @param filterString The filters to apply
*/
export const getFilterFromMust = (
dateRangeStart: string,
dateRangeEnd: string,
filterString?: string | null
) => {
let filterClauses: any[] = [
{ range: { '@timestamp': { gte: dateRangeStart, lte: dateRangeEnd } } },
];
if (filterString) {
const filters = JSON.parse(filterString);
filterClauses = filterClauses.concat(filters.bool.must);
}
return {
bool: { filter: filterClauses },
};
};

View file

@ -4,5 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { formatEsBucketsForHistogram } from './format_es_buckets_for_histogram';
export { getFilteredQuery } from './get_filtered_query';
export { getFilteredQueryAndStatusFilter } from './get_filtered_query_and_status';
export { getFilterFromMust } from './get_filter_from_must';

View file

@ -4,176 +4,17 @@
"down": 2,
"total": 10,
"histogram": [
{
"monitorId": "auto-tcp-0X81440A68E839814C",
"data": [
{ "upCount": 1, "downCount": 293, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": null, "downCount": 300, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 145, "downCount": 155, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 77, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0XD9AE729FC1C1E04A",
"data": [
{ "upCount": 79, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 80, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 86, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 87, "downCount": 1, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 81, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 100, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 100, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 99, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 96, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 81, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 80, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 20, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0XDD2D4E60FD4A61C3",
"data": [
{ "upCount": 79, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 80, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 86, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 88, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 81, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 95, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 94, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 98, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 93, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 81, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 80, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 20, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0X131221E73F825974",
"data": [
{ "upCount": 74, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 73, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 74, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 19, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0X3675F89EF0612091",
"data": [
{ "upCount": null, "downCount": 74, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": null, "downCount": 19, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0X9CB71300ABD5A2A8",
"data": [
{ "upCount": 69, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 70, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 68, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 69, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 69, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 69, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 70, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 70, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 70, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 69, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 70, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 18, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0X970CBD2F2102BFA8",
"data": [
{ "upCount": 58, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 16, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0XA8096548ECEB85B7",
"data": [
{ "upCount": null, "downCount": 57, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": null, "downCount": 60, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": null, "downCount": 61, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": null, "downCount": 56, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": null, "downCount": 45, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": null, "downCount": 49, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": null, "downCount": 60, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": null, "downCount": 60, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": null, "downCount": 64, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": null, "downCount": 59, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": null, "downCount": 60, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": null, "downCount": 14, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0XC9CDA429418EDC2B",
"data": [
{ "upCount": 5, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 1, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0XE3B163481423197D",
"data": [
{ "upCount": 5, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 1, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
}
{ "upCount": 7, "downCount": 3, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 7, "downCount": 3, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 7, "downCount": 3, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 7, "downCount": 3, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 8, "downCount": 2, "x": 1548700920000, "x0": 1548700620000, "y": 1 }
]
}
}

View file

@ -1 +1 @@
{ "snapshot": { "up": 0, "down": 0, "total": 0, "histogram": null } }
{ "snapshot": { "up": 0, "down": 0, "total": 0, "histogram": [] } }

View file

@ -4,40 +4,17 @@
"down": 2,
"total": 2,
"histogram": [
{
"monitorId": "auto-http-0X3675F89EF0612091",
"data": [
{ "upCount": null, "downCount": 74, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": null, "downCount": 75, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": null, "downCount": 19, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0XA8096548ECEB85B7",
"data": [
{ "upCount": null, "downCount": 57, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": null, "downCount": 60, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": null, "downCount": 61, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": null, "downCount": 56, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": null, "downCount": 45, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": null, "downCount": 49, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": null, "downCount": 60, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": null, "downCount": 60, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": null, "downCount": 64, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": null, "downCount": 59, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": null, "downCount": 60, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": null, "downCount": 14, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
}
{ "upCount": 0, "downCount": 3, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 0, "downCount": 3, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 0, "downCount": 3, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 0, "downCount": 3, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 0, "downCount": 2, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 0, "downCount": 2, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 0, "downCount": 2, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 0, "downCount": 2, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 0, "downCount": 2, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 0, "downCount": 2, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 0, "downCount": 2, "x": 1548700920000, "x0": 1548700620000, "y": 1 }
]
}
}

View file

@ -4,142 +4,17 @@
"down": 0,
"total": 8,
"histogram": [
{
"monitorId": "auto-tcp-0X81440A68E839814C",
"data": [
{ "upCount": 1, "downCount": 293, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": null, "downCount": 300, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 145, "downCount": 155, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 300, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 77, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0XD9AE729FC1C1E04A",
"data": [
{ "upCount": 79, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 80, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 86, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 87, "downCount": 1, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 81, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 100, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 100, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 99, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 96, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 81, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 80, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 20, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0XDD2D4E60FD4A61C3",
"data": [
{ "upCount": 79, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 80, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 86, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 88, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 81, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 95, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 94, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 98, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 93, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 81, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 80, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 20, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0X131221E73F825974",
"data": [
{ "upCount": 74, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 73, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 74, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 75, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 19, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0X9CB71300ABD5A2A8",
"data": [
{ "upCount": 69, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 70, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 68, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 69, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 69, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 69, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 70, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 70, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 70, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 69, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 70, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 18, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0X970CBD2F2102BFA8",
"data": [
{ "upCount": 58, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 60, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 16, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0XC9CDA429418EDC2B",
"data": [
{ "upCount": 5, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 1, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
},
{
"monitorId": "auto-http-0XE3B163481423197D",
"data": [
{ "upCount": 5, "downCount": null, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 5, "downCount": null, "x": 1548700920000, "x0": 1548700620000, "y": 1 },
{ "upCount": 1, "downCount": null, "x": 1548701220000, "x0": 1548700920000, "y": 1 }
]
}
{ "upCount": 8, "downCount": 0, "x": 1548697920000, "x0": 1548697620000, "y": 1 },
{ "upCount": 7, "downCount": 0, "x": 1548698220000, "x0": 1548697920000, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548698520000, "x0": 1548698220000, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548698820000, "x0": 1548698520000, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548699120000, "x0": 1548698820000, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548699420000, "x0": 1548699120000, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548699720000, "x0": 1548699420000, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548700020000, "x0": 1548699720000, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548700320000, "x0": 1548700020000, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548700620000, "x0": 1548700320000, "y": 1 },
{ "upCount": 8, "downCount": 0, "x": 1548700920000, "x0": 1548700620000, "y": 1 }
]
}
}