From b2c3985148a227dc98d7c6222270322d5b83b200 Mon Sep 17 00:00:00 2001 From: Phillip Burch Date: Wed, 13 Nov 2019 08:14:05 -0600 Subject: [PATCH 1/2] Update x-pack/legacy/plugins/infra/server/utils/calculate_metric_interval.ts Co-Authored-By: Chris Cowan --- .../plugins/infra/server/utils/calculate_metric_interval.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/infra/server/utils/calculate_metric_interval.ts b/x-pack/legacy/plugins/infra/server/utils/calculate_metric_interval.ts index 09abe17a3cf87..7696abd2ac250 100644 --- a/x-pack/legacy/plugins/infra/server/utils/calculate_metric_interval.ts +++ b/x-pack/legacy/plugins/infra/server/utils/calculate_metric_interval.ts @@ -76,7 +76,7 @@ export const calculateMetricInterval = async ( return; } - return Math.max(...intervals); + return Math.max(...intervals) / 1000; }; interface PeriodAggregationData { From a13211a117263104701b30e04f46289c473ceadf Mon Sep 17 00:00:00 2001 From: Phillip Burch Date: Wed, 13 Nov 2019 08:26:26 -0600 Subject: [PATCH 2/2] Update x-pack/legacy/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts Co-Authored-By: Chris Cowan --- .../lib/populate_series_with_tsvb_data.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts b/x-pack/legacy/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts index f94952d2fee69..8fd08e131dcb9 100644 --- a/x-pack/legacy/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts +++ b/x-pack/legacy/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts @@ -63,7 +63,14 @@ export const populateSeriesWithTSVBData = ( timestampField: options.timerange.field, timerange: options.timerange, }, - model.requires + options.metrics + .filter(metric => metric.field) + .map(metric => { + return metric + .field!.split(/\./) + .slice(0, 2) + .join('.'); + }) ); if (calculatedInterval) {