Skip to content

Commit

Permalink
[Uptime] In Ping histogram use auto date histogram (#55605) (#56369)
Browse files Browse the repository at this point in the history
* update ping histogram API

* update test

* fix tests

* update test

* unused code

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
shahzad31 and elasticmachine authored Jan 30, 2020
1 parent e16938c commit 527e117
Show file tree
Hide file tree
Showing 53 changed files with 644 additions and 1,180 deletions.
7 changes: 0 additions & 7 deletions x-pack/legacy/plugins/uptime/common/domain_types/monitors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { HistogramDataPoint } from '../graphql/types';

export interface UMGqlRange {
dateRangeStart: string;
dateRangeEnd: string;
}

export interface HistogramResult {
histogram: HistogramDataPoint[];
interval: number;
}
137 changes: 0 additions & 137 deletions x-pack/legacy/plugins/uptime/common/graphql/introspection.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,65 +166,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "getSnapshotHistogram",
"description": "",
"args": [
{
"name": "dateRangeStart",
"description": "",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": { "kind": "SCALAR", "name": "String", "ofType": null }
},
"defaultValue": null
},
{
"name": "dateRangeEnd",
"description": "",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": { "kind": "SCALAR", "name": "String", "ofType": null }
},
"defaultValue": null
},
{
"name": "filters",
"description": "",
"type": { "kind": "SCALAR", "name": "String", "ofType": null },
"defaultValue": null
},
{
"name": "statusFilter",
"description": "",
"type": { "kind": "SCALAR", "name": "String", "ofType": null },
"defaultValue": null
},
{
"name": "monitorId",
"description": "",
"type": { "kind": "SCALAR", "name": "String", "ofType": null },
"defaultValue": null
}
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": { "kind": "OBJECT", "name": "HistogramDataPoint", "ofType": null }
}
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "getMonitorChartsData",
"description": "",
Expand Down Expand Up @@ -2172,57 +2113,6 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "HistogramDataPoint",
"description": "",
"fields": [
{
"name": "upCount",
"description": "",
"args": [],
"type": { "kind": "SCALAR", "name": "Int", "ofType": null },
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "downCount",
"description": "",
"args": [],
"type": { "kind": "SCALAR", "name": "Int", "ofType": null },
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "x",
"description": "",
"args": [],
"type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null },
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "x0",
"description": "",
"args": [],
"type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null },
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "y",
"description": "",
"args": [],
"type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null },
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "MonitorChart",
Expand Down Expand Up @@ -3944,33 +3834,6 @@
],
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "DataPoint",
"description": "",
"fields": [
{
"name": "x",
"description": "",
"args": [],
"type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null },
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "y",
"description": "",
"args": [],
"type": { "kind": "SCALAR", "name": "Float", "ofType": null },
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "MonitorDurationAreaPoint",
Expand Down
86 changes: 0 additions & 86 deletions x-pack/legacy/plugins/uptime/common/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ export interface Query {

getSnapshot?: Snapshot | null;

getSnapshotHistogram: HistogramDataPoint[];

getMonitorChartsData?: MonitorChart | null;
/** Fetch the most recent event data for a monitor ID, date range, location. */
getLatestMonitors: Ping[];
Expand Down Expand Up @@ -419,17 +417,7 @@ export interface SnapshotCount {
total: number;
}

export interface HistogramDataPoint {
upCount?: number | null;

downCount?: number | null;

x?: UnsignedInteger | null;

x0?: UnsignedInteger | null;

y?: UnsignedInteger | null;
}
/** The data used to populate the monitor charts. */
export interface MonitorChart {
/** The average values for the monitor duration. */
Expand Down Expand Up @@ -616,47 +604,6 @@ export interface StatesIndexStatus {
docCount?: DocCount | null;
}

export interface DataPoint {
x?: UnsignedInteger | null;

y?: number | null;
}
/** Represents a monitor's duration performance in microseconds at a point in time. */
export interface MonitorDurationAreaPoint {
/** The timeseries value for this point in time. */
x: UnsignedInteger;
/** The min duration value in microseconds at this time. */
yMin?: number | null;
/** The max duration value in microseconds at this point. */
yMax?: number | null;
}

export interface MonitorSummaryUrl {
domain?: string | null;

fragment?: string | null;

full?: string | null;

original?: string | null;

password?: string | null;

path?: string | null;

port?: number | null;

query?: string | null;

scheme?: string | null;

username?: string | null;
}

// ====================================================
// Arguments
// ====================================================

export interface AllPingsQueryArgs {
/** Optional: the direction to sort by. Accepts 'asc' and 'desc'. Defaults to 'desc'. */
sort?: string | null;
Expand All @@ -673,35 +620,7 @@ export interface AllPingsQueryArgs {
/** Optional: agent location to filter by. */
location?: string | null;
}
export interface GetMonitorsQueryArgs {
dateRangeStart: string;

dateRangeEnd: string;

filters?: string | null;

statusFilter?: string | null;
}
export interface GetSnapshotQueryArgs {
dateRangeStart: string;

dateRangeEnd: string;

filters?: string | null;

statusFilter?: string | null;
}
export interface GetSnapshotHistogramQueryArgs {
dateRangeStart: string;

dateRangeEnd: string;

filters?: string | null;

statusFilter?: string | null;

monitorId?: string | null;
}
export interface GetMonitorChartsDataQueryArgs {
monitorId: string;

Expand All @@ -711,11 +630,6 @@ export interface GetMonitorChartsDataQueryArgs {

location?: string | null;
}
export interface GetFilterBarQueryArgs {
dateRangeStart: string;

dateRangeEnd: string;
}

export interface GetMonitorStatesQueryArgs {
dateRangeStart: string;
Expand Down
7 changes: 7 additions & 0 deletions x-pack/legacy/plugins/uptime/common/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export * from './ping/histogram';
32 changes: 32 additions & 0 deletions x-pack/legacy/plugins/uptime/common/types/ping/histogram.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export type UnsignedInteger = any;

export interface HistogramDataPoint {
upCount?: number | null;

downCount?: number | null;

x?: UnsignedInteger | null;

x0?: UnsignedInteger | null;

y?: UnsignedInteger | null;
}

export interface GetPingHistogramParams {
dateStart: string;
dateEnd: string;
filters?: string;
monitorId?: string;
statusFilter?: string;
}

export interface HistogramResult {
histogram: HistogramDataPoint[];
interval: string;
}
Loading

0 comments on commit 527e117

Please sign in to comment.