From 306b47c42aed5b356cf86fa58715e7e6495c40d5 Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Mon, 8 Jul 2019 20:19:29 +0200 Subject: [PATCH] [APM] Migrate deprecated date_histogram parameter (#39886) (#40521) * [APM] Migrate deprecated date_histogram parameter Closes #39584. Replaces 'interval' with 'fixed_interval' * Update snapshot --- x-pack/legacy/plugins/apm/server/lib/helpers/metrics.ts | 2 +- .../get_anomaly_data/__snapshots__/fetcher.test.ts.snap | 2 +- .../lib/transactions/charts/get_anomaly_data/fetcher.ts | 2 +- .../get_timeseries_data/__snapshots__/fetcher.test.ts.snap | 4 ++-- .../lib/transactions/charts/get_timeseries_data/fetcher.ts | 4 ++-- .../lib/transactions/distribution/get_buckets/fetcher.ts | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/x-pack/legacy/plugins/apm/server/lib/helpers/metrics.ts b/x-pack/legacy/plugins/apm/server/lib/helpers/metrics.ts index df2d6dcf523bf..cb5e37d9a8773 100644 --- a/x-pack/legacy/plugins/apm/server/lib/helpers/metrics.ts +++ b/x-pack/legacy/plugins/apm/server/lib/helpers/metrics.ts @@ -12,7 +12,7 @@ export function getMetricsDateHistogramParams(start: number, end: number) { field: '@timestamp', // ensure minimum bucket size of 30s since this is the default resolution for metric data - interval: `${Math.max(bucketSize, 30)}s`, + fixed_interval: `${Math.max(bucketSize, 30)}s`, min_doc_count: 0, extended_bounds: { min: start, max: end } diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/__snapshots__/fetcher.test.ts.snap b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/__snapshots__/fetcher.test.ts.snap index 5c5b391be9603..3ad87c48b013d 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/__snapshots__/fetcher.test.ts.snap +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/__snapshots__/fetcher.test.ts.snap @@ -30,7 +30,7 @@ Array [ "min": 90000, }, "field": "timestamp", - "interval": "myInterval", + "fixed_interval": "myInterval", "min_doc_count": 0, }, }, diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts index b8af24b840d99..9b51d9336d2e6 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts @@ -56,7 +56,7 @@ export async function anomalySeriesFetcher({ ml_avg_response_times: { date_histogram: { field: 'timestamp', - interval: intervalString, + fixed_interval: intervalString, min_doc_count: 0, extended_bounds: { min: newStart, diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/fetcher.test.ts.snap b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/fetcher.test.ts.snap index f5c6b99db9683..6c8430a3e71cf 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/fetcher.test.ts.snap +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/fetcher.test.ts.snap @@ -34,7 +34,7 @@ Array [ "min": 1528113600000, }, "field": "@timestamp", - "interval": "10800s", + "fixed_interval": "10800s", "min_doc_count": 0, }, }, @@ -47,7 +47,7 @@ Array [ "min": 1528113600000, }, "field": "@timestamp", - "interval": "10800s", + "fixed_interval": "10800s", "min_doc_count": 0, }, }, diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts index 8ccf1af568535..9ce664fa21e79 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts @@ -58,7 +58,7 @@ export function timeseriesFetcher({ response_times: { date_histogram: { field: '@timestamp', - interval: intervalString, + fixed_interval: intervalString, min_doc_count: 0, extended_bounds: { min: start, max: end } }, @@ -76,7 +76,7 @@ export function timeseriesFetcher({ timeseries: { date_histogram: { field: '@timestamp', - interval: intervalString, + fixed_interval: intervalString, min_doc_count: 0, extended_bounds: { min: start, max: end } } diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/distribution/get_buckets/fetcher.ts b/x-pack/legacy/plugins/apm/server/lib/transactions/distribution/get_buckets/fetcher.ts index d265aa5173d2f..abd64dde93f6e 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/distribution/get_buckets/fetcher.ts +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/distribution/get_buckets/fetcher.ts @@ -54,7 +54,7 @@ export function bucketFetcher( distribution: { histogram: { field: TRANSACTION_DURATION, - interval: bucketSize, + fixed_interval: bucketSize, min_doc_count: 0, extended_bounds: { min: 0,