From 80f497900b6a9dcb2befd307096c34125d18a57b Mon Sep 17 00:00:00 2001 From: Chris Roberson Date: Fri, 24 May 2019 17:28:04 -0400 Subject: [PATCH] [Monitoring] Used fixed_interval explicitly for date_histogram aggregations (#37023) * Used fixed interval explicitly * Fix tests --- .../__test__/__snapshots__/get_metric_aggs.test.js.snap | 8 ++++---- .../lib/elasticsearch/nodes/get_nodes/get_metric_aggs.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/__test__/__snapshots__/get_metric_aggs.test.js.snap b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/__test__/__snapshots__/get_metric_aggs.test.js.snap index b5f8ad2b8b84..8b5b445b9311 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/__test__/__snapshots__/get_metric_aggs.test.js.snap +++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/__test__/__snapshots__/get_metric_aggs.test.js.snap @@ -18,7 +18,7 @@ Object { }, "date_histogram": Object { "field": "timestamp", - "interval": "30s", + "fixed_interval": "30s", "min_doc_count": 1, }, }, @@ -38,7 +38,7 @@ Object { }, "date_histogram": Object { "field": "timestamp", - "interval": "30s", + "fixed_interval": "30s", "min_doc_count": 1, }, }, @@ -76,7 +76,7 @@ Object { }, "date_histogram": Object { "field": "timestamp", - "interval": "30s", + "fixed_interval": "30s", "min_doc_count": 1, }, }, @@ -109,7 +109,7 @@ Object { }, "date_histogram": Object { "field": "timestamp", - "interval": "30s", + "fixed_interval": "30s", "min_doc_count": 1, }, }, diff --git a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_metric_aggs.js b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_metric_aggs.js index 9f135ae1da38..ff2d0470968b 100644 --- a/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_metric_aggs.js +++ b/x-pack/legacy/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_metric_aggs.js @@ -47,7 +47,7 @@ export function getMetricAggs(listingMetrics, bucketSize) { date_histogram: { field: 'timestamp', min_doc_count: 1, - interval: bucketSize + 's' + fixed_interval: bucketSize + 's' }, aggs: metric.aggs || metricAgg };