From 91491e70731ffaaa51d778d9b3de58ae22521a25 Mon Sep 17 00:00:00 2001 From: cauemarcondes Date: Mon, 7 Dec 2020 13:38:32 +0100 Subject: [PATCH 01/10] breaking /transactions/charts into /latency and /thoughput --- .../__tests__/get_buckets.test.ts | 2 +- .../__snapshots__/fetcher.test.ts.snap | 111 - .../__snapshots__/transform.test.ts.snap | 4106 ----------------- .../get_timeseries_data/fetcher.test.ts | 69 - .../charts/get_timeseries_data/index.ts | 29 - .../get_timeseries_data/transform.test.ts | 290 +- .../charts/get_timeseries_data/transform.ts | 105 - .../server/lib/transactions/charts/index.ts | 39 - .../server/lib/transactions/queries.test.ts | 54 +- .../apm/server/routes/create_apm_api.ts | 6 +- .../transactions/get_latency_charts/index.ts} | 106 +- .../get_latency_charts/transform.ts | 31 + .../get_throughput_charts/index.ts | 137 + .../get_throughput_charts/transform.ts | 51 + .../transactions/transactions_routes.ts | 120 +- 15 files changed, 539 insertions(+), 4717 deletions(-) delete mode 100644 x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/fetcher.test.ts.snap delete mode 100644 x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/transform.test.ts.snap delete mode 100644 x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.test.ts delete mode 100644 x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/index.ts delete mode 100644 x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts delete mode 100644 x-pack/plugins/apm/server/lib/transactions/charts/index.ts rename x-pack/plugins/apm/server/{lib/transactions/charts/get_timeseries_data/fetcher.ts => routes/transactions/get_latency_charts/index.ts} (52%) create mode 100644 x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts create mode 100644 x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts create mode 100644 x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.ts diff --git a/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts b/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts index 50da1f9c20d16..ff7d05efc1802 100644 --- a/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts +++ b/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/get_buckets.test.ts @@ -8,7 +8,7 @@ import { getBuckets } from '../get_buckets'; import { APMConfig } from '../../../..'; import { ProcessorEvent } from '../../../../../common/processor_event'; -describe('timeseriesFetcher', () => { +describe('get buckets', () => { let clientSpy: jest.Mock; beforeEach(async () => { diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/fetcher.test.ts.snap b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/fetcher.test.ts.snap deleted file mode 100644 index fb696b40f4ab4..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/fetcher.test.ts.snap +++ /dev/null @@ -1,111 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`timeseriesFetcher should call client with correct query 1`] = ` -Array [ - Array [ - Object { - "apm": Object { - "events": Array [ - "transaction", - ], - }, - "body": Object { - "aggs": Object { - "overall_avg_duration": Object { - "avg": Object { - "field": "transaction.duration.us", - }, - }, - "response_times": Object { - "aggs": Object { - "avg": Object { - "avg": Object { - "field": "transaction.duration.us", - }, - }, - "pct": Object { - "percentiles": Object { - "field": "transaction.duration.us", - "hdr": Object { - "number_of_significant_value_digits": 2, - }, - "percents": Array [ - 95, - 99, - ], - }, - }, - }, - "date_histogram": Object { - "extended_bounds": Object { - "max": 1528977600000, - "min": 1528113600000, - }, - "field": "@timestamp", - "fixed_interval": "10800s", - "min_doc_count": 0, - }, - }, - "transaction_results": Object { - "aggs": Object { - "timeseries": Object { - "aggs": Object { - "count": Object { - "value_count": Object { - "field": "transaction.duration.us", - }, - }, - }, - "date_histogram": Object { - "extended_bounds": Object { - "max": 1528977600000, - "min": 1528113600000, - }, - "field": "@timestamp", - "fixed_interval": "10800s", - "min_doc_count": 0, - }, - }, - }, - "terms": Object { - "field": "transaction.result", - "missing": "", - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "service.name": "myServiceName", - }, - }, - Object { - "range": Object { - "@timestamp": Object { - "format": "epoch_millis", - "gte": 1528113600000, - "lte": 1528977600000, - }, - }, - }, - Object { - "term": Object { - "service.environment": "test", - }, - }, - Object { - "term": Object { - "transaction.type": "myTransactionType", - }, - }, - ], - }, - }, - "size": 0, - }, - }, - ], -] -`; diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/transform.test.ts.snap b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/transform.test.ts.snap deleted file mode 100644 index 46d6c1425d599..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/__snapshots__/transform.test.ts.snap +++ /dev/null @@ -1,4106 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`timeseriesTransformer should match snapshot 1`] = ` -Object { - "overallAvgDuration": 73065.05176360115, - "responseTimes": Object { - "avg": Array [ - Object { - "x": 1593852000000, - "y": null, - }, - Object { - "x": 1593852600000, - "y": null, - }, - Object { - "x": 1593853200000, - "y": null, - }, - Object { - "x": 1593853800000, - "y": null, - }, - Object { - "x": 1593854400000, - "y": null, - }, - Object { - "x": 1593855000000, - "y": null, - }, - Object { - "x": 1593855600000, - "y": null, - }, - Object { - "x": 1593856200000, - "y": null, - }, - Object { - "x": 1593856800000, - "y": null, - }, - Object { - "x": 1593857400000, - "y": null, - }, - Object { - "x": 1593858000000, - "y": null, - }, - Object { - "x": 1593858600000, - "y": null, - }, - Object { - "x": 1593859200000, - "y": null, - }, - Object { - "x": 1593859800000, - "y": null, - }, - Object { - "x": 1593860400000, - "y": null, - }, - Object { - "x": 1593861000000, - "y": null, - }, - Object { - "x": 1593861600000, - "y": null, - }, - Object { - "x": 1593862200000, - "y": null, - }, - Object { - "x": 1593862800000, - "y": null, - }, - Object { - "x": 1593863400000, - "y": null, - }, - Object { - "x": 1593864000000, - "y": null, - }, - Object { - "x": 1593864600000, - "y": null, - }, - Object { - "x": 1593865200000, - "y": null, - }, - Object { - "x": 1593865800000, - "y": null, - }, - Object { - "x": 1593866400000, - "y": null, - }, - Object { - "x": 1593867000000, - "y": null, - }, - Object { - "x": 1593867600000, - "y": null, - }, - Object { - "x": 1593868200000, - "y": null, - }, - Object { - "x": 1593868800000, - "y": null, - }, - Object { - "x": 1593869400000, - "y": null, - }, - Object { - "x": 1593870000000, - "y": null, - }, - Object { - "x": 1593870600000, - "y": null, - }, - Object { - "x": 1593871200000, - "y": null, - }, - Object { - "x": 1593871800000, - "y": null, - }, - Object { - "x": 1593872400000, - "y": null, - }, - Object { - "x": 1593873000000, - "y": null, - }, - Object { - "x": 1593873600000, - "y": null, - }, - Object { - "x": 1593874200000, - "y": null, - }, - Object { - "x": 1593874800000, - "y": null, - }, - Object { - "x": 1593875400000, - "y": null, - }, - Object { - "x": 1593876000000, - "y": null, - }, - Object { - "x": 1593876600000, - "y": null, - }, - Object { - "x": 1593877200000, - "y": null, - }, - Object { - "x": 1593877800000, - "y": null, - }, - Object { - "x": 1593878400000, - "y": null, - }, - Object { - "x": 1593879000000, - "y": null, - }, - Object { - "x": 1593879600000, - "y": null, - }, - Object { - "x": 1593880200000, - "y": null, - }, - Object { - "x": 1593880800000, - "y": null, - }, - Object { - "x": 1593881400000, - "y": null, - }, - Object { - "x": 1593882000000, - "y": null, - }, - Object { - "x": 1593882600000, - "y": null, - }, - Object { - "x": 1593883200000, - "y": null, - }, - Object { - "x": 1593883800000, - "y": null, - }, - Object { - "x": 1593884400000, - "y": null, - }, - Object { - "x": 1593885000000, - "y": null, - }, - Object { - "x": 1593885600000, - "y": null, - }, - Object { - "x": 1593886200000, - "y": null, - }, - Object { - "x": 1593886800000, - "y": null, - }, - Object { - "x": 1593887400000, - "y": null, - }, - Object { - "x": 1593888000000, - "y": null, - }, - Object { - "x": 1593888600000, - "y": 43364.46153846154, - }, - Object { - "x": 1593889200000, - "y": 147903.58671586716, - }, - Object { - "x": 1593889800000, - "y": 57370.52342487884, - }, - Object { - "x": 1593890400000, - "y": 59687.82558139535, - }, - Object { - "x": 1593891000000, - "y": 51810.68111455108, - }, - Object { - "x": 1593891600000, - "y": 51736.59420289855, - }, - Object { - "x": 1593892200000, - "y": 37241.293224299065, - }, - Object { - "x": 1593892800000, - "y": 49444.90771558245, - }, - Object { - "x": 1593893400000, - "y": 56807.80495356037, - }, - Object { - "x": 1593894000000, - "y": 43238.74519846351, - }, - Object { - "x": 1593894600000, - "y": 51754.80149253731, - }, - Object { - "x": 1593895200000, - "y": 47166.5964343598, - }, - Object { - "x": 1593895800000, - "y": 41854.688405797104, - }, - Object { - "x": 1593896400000, - "y": 30464.317912218266, - }, - Object { - "x": 1593897000000, - "y": 41558.531380753135, - }, - Object { - "x": 1593897600000, - "y": 41159.68345323741, - }, - Object { - "x": 1593898200000, - "y": 34211.03967168263, - }, - Object { - "x": 1593898800000, - "y": 41322.30621301775, - }, - Object { - "x": 1593899400000, - "y": 42301.523605150214, - }, - Object { - "x": 1593900000000, - "y": 59615.69343065693, - }, - Object { - "x": 1593900600000, - "y": 29567.520050125313, - }, - Object { - "x": 1593901200000, - "y": 56104.7484375, - }, - Object { - "x": 1593901800000, - "y": 40900.70954356847, - }, - Object { - "x": 1593902400000, - "y": null, - }, - Object { - "x": 1593903000000, - "y": null, - }, - Object { - "x": 1593903600000, - "y": 141618.04, - }, - Object { - "x": 1593904200000, - "y": null, - }, - Object { - "x": 1593904800000, - "y": null, - }, - Object { - "x": 1593905400000, - "y": null, - }, - Object { - "x": 1593906000000, - "y": 380742.48780487804, - }, - Object { - "x": 1593906600000, - "y": null, - }, - Object { - "x": 1593907200000, - "y": null, - }, - Object { - "x": 1593907800000, - "y": null, - }, - Object { - "x": 1593908400000, - "y": null, - }, - Object { - "x": 1593909000000, - "y": null, - }, - Object { - "x": 1593909600000, - "y": null, - }, - Object { - "x": 1593910200000, - "y": 122524.7027027027, - }, - Object { - "x": 1593910800000, - "y": null, - }, - Object { - "x": 1593911400000, - "y": null, - }, - Object { - "x": 1593912000000, - "y": null, - }, - Object { - "x": 1593912600000, - "y": null, - }, - Object { - "x": 1593913200000, - "y": null, - }, - Object { - "x": 1593913800000, - "y": null, - }, - Object { - "x": 1593914400000, - "y": null, - }, - Object { - "x": 1593915000000, - "y": null, - }, - Object { - "x": 1593915600000, - "y": null, - }, - Object { - "x": 1593916200000, - "y": null, - }, - Object { - "x": 1593916800000, - "y": 160060.1081081081, - }, - Object { - "x": 1593917400000, - "y": null, - }, - Object { - "x": 1593918000000, - "y": null, - }, - Object { - "x": 1593918600000, - "y": null, - }, - Object { - "x": 1593919200000, - "y": null, - }, - Object { - "x": 1593919800000, - "y": null, - }, - Object { - "x": 1593920400000, - "y": null, - }, - Object { - "x": 1593921000000, - "y": null, - }, - Object { - "x": 1593921600000, - "y": null, - }, - Object { - "x": 1593922200000, - "y": null, - }, - Object { - "x": 1593922800000, - "y": null, - }, - Object { - "x": 1593923400000, - "y": 70357.234375, - }, - Object { - "x": 1593924000000, - "y": null, - }, - Object { - "x": 1593924600000, - "y": null, - }, - Object { - "x": 1593925200000, - "y": null, - }, - Object { - "x": 1593925800000, - "y": null, - }, - Object { - "x": 1593926400000, - "y": null, - }, - Object { - "x": 1593927000000, - "y": null, - }, - Object { - "x": 1593927600000, - "y": null, - }, - Object { - "x": 1593928200000, - "y": null, - }, - Object { - "x": 1593928800000, - "y": null, - }, - Object { - "x": 1593929400000, - "y": null, - }, - Object { - "x": 1593930000000, - "y": 269745.9036144578, - }, - Object { - "x": 1593930600000, - "y": null, - }, - Object { - "x": 1593931200000, - "y": null, - }, - Object { - "x": 1593931800000, - "y": null, - }, - Object { - "x": 1593932400000, - "y": 313349.95238095237, - }, - Object { - "x": 1593933000000, - "y": null, - }, - Object { - "x": 1593933600000, - "y": null, - }, - Object { - "x": 1593934200000, - "y": null, - }, - Object { - "x": 1593934800000, - "y": null, - }, - Object { - "x": 1593935400000, - "y": null, - }, - Object { - "x": 1593936000000, - "y": null, - }, - Object { - "x": 1593936600000, - "y": 397251.288372093, - }, - Object { - "x": 1593937200000, - "y": 361953.5931174089, - }, - Object { - "x": 1593937800000, - "y": 259173.0694980695, - }, - Object { - "x": 1593938400000, - "y": 79648.20935412026, - }, - ], - "p95": Array [ - Object { - "x": 1593852000000, - "y": null, - }, - Object { - "x": 1593852600000, - "y": null, - }, - Object { - "x": 1593853200000, - "y": null, - }, - Object { - "x": 1593853800000, - "y": null, - }, - Object { - "x": 1593854400000, - "y": null, - }, - Object { - "x": 1593855000000, - "y": null, - }, - Object { - "x": 1593855600000, - "y": null, - }, - Object { - "x": 1593856200000, - "y": null, - }, - Object { - "x": 1593856800000, - "y": null, - }, - Object { - "x": 1593857400000, - "y": null, - }, - Object { - "x": 1593858000000, - "y": null, - }, - Object { - "x": 1593858600000, - "y": null, - }, - Object { - "x": 1593859200000, - "y": null, - }, - Object { - "x": 1593859800000, - "y": null, - }, - Object { - "x": 1593860400000, - "y": null, - }, - Object { - "x": 1593861000000, - "y": null, - }, - Object { - "x": 1593861600000, - "y": null, - }, - Object { - "x": 1593862200000, - "y": null, - }, - Object { - "x": 1593862800000, - "y": null, - }, - Object { - "x": 1593863400000, - "y": null, - }, - Object { - "x": 1593864000000, - "y": null, - }, - Object { - "x": 1593864600000, - "y": null, - }, - Object { - "x": 1593865200000, - "y": null, - }, - Object { - "x": 1593865800000, - "y": null, - }, - Object { - "x": 1593866400000, - "y": null, - }, - Object { - "x": 1593867000000, - "y": null, - }, - Object { - "x": 1593867600000, - "y": null, - }, - Object { - "x": 1593868200000, - "y": null, - }, - Object { - "x": 1593868800000, - "y": null, - }, - Object { - "x": 1593869400000, - "y": null, - }, - Object { - "x": 1593870000000, - "y": null, - }, - Object { - "x": 1593870600000, - "y": null, - }, - Object { - "x": 1593871200000, - "y": null, - }, - Object { - "x": 1593871800000, - "y": null, - }, - Object { - "x": 1593872400000, - "y": null, - }, - Object { - "x": 1593873000000, - "y": null, - }, - Object { - "x": 1593873600000, - "y": null, - }, - Object { - "x": 1593874200000, - "y": null, - }, - Object { - "x": 1593874800000, - "y": null, - }, - Object { - "x": 1593875400000, - "y": null, - }, - Object { - "x": 1593876000000, - "y": null, - }, - Object { - "x": 1593876600000, - "y": null, - }, - Object { - "x": 1593877200000, - "y": null, - }, - Object { - "x": 1593877800000, - "y": null, - }, - Object { - "x": 1593878400000, - "y": null, - }, - Object { - "x": 1593879000000, - "y": null, - }, - Object { - "x": 1593879600000, - "y": null, - }, - Object { - "x": 1593880200000, - "y": null, - }, - Object { - "x": 1593880800000, - "y": null, - }, - Object { - "x": 1593881400000, - "y": null, - }, - Object { - "x": 1593882000000, - "y": null, - }, - Object { - "x": 1593882600000, - "y": null, - }, - Object { - "x": 1593883200000, - "y": null, - }, - Object { - "x": 1593883800000, - "y": null, - }, - Object { - "x": 1593884400000, - "y": null, - }, - Object { - "x": 1593885000000, - "y": null, - }, - Object { - "x": 1593885600000, - "y": null, - }, - Object { - "x": 1593886200000, - "y": null, - }, - Object { - "x": 1593886800000, - "y": null, - }, - Object { - "x": 1593887400000, - "y": null, - }, - Object { - "x": 1593888000000, - "y": null, - }, - Object { - "x": 1593888600000, - "y": 114680, - }, - Object { - "x": 1593889200000, - "y": 659448, - }, - Object { - "x": 1593889800000, - "y": 122360, - }, - Object { - "x": 1593890400000, - "y": 121336, - }, - Object { - "x": 1593891000000, - "y": 120828, - }, - Object { - "x": 1593891600000, - "y": 139256, - }, - Object { - "x": 1593892200000, - "y": 76792, - }, - Object { - "x": 1593892800000, - "y": 129528, - }, - Object { - "x": 1593893400000, - "y": 378872, - }, - Object { - "x": 1593894000000, - "y": 97272, - }, - Object { - "x": 1593894600000, - "y": 102904, - }, - Object { - "x": 1593895200000, - "y": 100856, - }, - Object { - "x": 1593895800000, - "y": 97784, - }, - Object { - "x": 1593896400000, - "y": 72700, - }, - Object { - "x": 1593897000000, - "y": 98296, - }, - Object { - "x": 1593897600000, - "y": 112120, - }, - Object { - "x": 1593898200000, - "y": 91640, - }, - Object { - "x": 1593898800000, - "y": 83448, - }, - Object { - "x": 1593899400000, - "y": 84476, - }, - Object { - "x": 1593900000000, - "y": 117756, - }, - Object { - "x": 1593900600000, - "y": 66556, - }, - Object { - "x": 1593901200000, - "y": 130552, - }, - Object { - "x": 1593901800000, - "y": 111608, - }, - Object { - "x": 1593902400000, - "y": null, - }, - Object { - "x": 1593903000000, - "y": null, - }, - Object { - "x": 1593903600000, - "y": 276448, - }, - Object { - "x": 1593904200000, - "y": null, - }, - Object { - "x": 1593904800000, - "y": null, - }, - Object { - "x": 1593905400000, - "y": null, - }, - Object { - "x": 1593906000000, - "y": 1028088, - }, - Object { - "x": 1593906600000, - "y": null, - }, - Object { - "x": 1593907200000, - "y": null, - }, - Object { - "x": 1593907800000, - "y": null, - }, - Object { - "x": 1593908400000, - "y": null, - }, - Object { - "x": 1593909000000, - "y": null, - }, - Object { - "x": 1593909600000, - "y": null, - }, - Object { - "x": 1593910200000, - "y": 352128, - }, - Object { - "x": 1593910800000, - "y": null, - }, - Object { - "x": 1593911400000, - "y": null, - }, - Object { - "x": 1593912000000, - "y": null, - }, - Object { - "x": 1593912600000, - "y": null, - }, - Object { - "x": 1593913200000, - "y": null, - }, - Object { - "x": 1593913800000, - "y": null, - }, - Object { - "x": 1593914400000, - "y": null, - }, - Object { - "x": 1593915000000, - "y": null, - }, - Object { - "x": 1593915600000, - "y": null, - }, - Object { - "x": 1593916200000, - "y": null, - }, - Object { - "x": 1593916800000, - "y": 348144, - }, - Object { - "x": 1593917400000, - "y": null, - }, - Object { - "x": 1593918000000, - "y": null, - }, - Object { - "x": 1593918600000, - "y": null, - }, - Object { - "x": 1593919200000, - "y": null, - }, - Object { - "x": 1593919800000, - "y": null, - }, - Object { - "x": 1593920400000, - "y": null, - }, - Object { - "x": 1593921000000, - "y": null, - }, - Object { - "x": 1593921600000, - "y": null, - }, - Object { - "x": 1593922200000, - "y": null, - }, - Object { - "x": 1593922800000, - "y": null, - }, - Object { - "x": 1593923400000, - "y": 270328, - }, - Object { - "x": 1593924000000, - "y": null, - }, - Object { - "x": 1593924600000, - "y": null, - }, - Object { - "x": 1593925200000, - "y": null, - }, - Object { - "x": 1593925800000, - "y": null, - }, - Object { - "x": 1593926400000, - "y": null, - }, - Object { - "x": 1593927000000, - "y": null, - }, - Object { - "x": 1593927600000, - "y": null, - }, - Object { - "x": 1593928200000, - "y": null, - }, - Object { - "x": 1593928800000, - "y": null, - }, - Object { - "x": 1593929400000, - "y": null, - }, - Object { - "x": 1593930000000, - "y": 1687544, - }, - Object { - "x": 1593930600000, - "y": null, - }, - Object { - "x": 1593931200000, - "y": null, - }, - Object { - "x": 1593931800000, - "y": null, - }, - Object { - "x": 1593932400000, - "y": 798656, - }, - Object { - "x": 1593933000000, - "y": null, - }, - Object { - "x": 1593933600000, - "y": null, - }, - Object { - "x": 1593934200000, - "y": null, - }, - Object { - "x": 1593934800000, - "y": null, - }, - Object { - "x": 1593935400000, - "y": null, - }, - Object { - "x": 1593936000000, - "y": null, - }, - Object { - "x": 1593936600000, - "y": 3653624, - }, - Object { - "x": 1593937200000, - "y": 3276768, - }, - Object { - "x": 1593937800000, - "y": 522208, - }, - Object { - "x": 1593938400000, - "y": 372728, - }, - ], - "p99": Array [ - Object { - "x": 1593852000000, - "y": null, - }, - Object { - "x": 1593852600000, - "y": null, - }, - Object { - "x": 1593853200000, - "y": null, - }, - Object { - "x": 1593853800000, - "y": null, - }, - Object { - "x": 1593854400000, - "y": null, - }, - Object { - "x": 1593855000000, - "y": null, - }, - Object { - "x": 1593855600000, - "y": null, - }, - Object { - "x": 1593856200000, - "y": null, - }, - Object { - "x": 1593856800000, - "y": null, - }, - Object { - "x": 1593857400000, - "y": null, - }, - Object { - "x": 1593858000000, - "y": null, - }, - Object { - "x": 1593858600000, - "y": null, - }, - Object { - "x": 1593859200000, - "y": null, - }, - Object { - "x": 1593859800000, - "y": null, - }, - Object { - "x": 1593860400000, - "y": null, - }, - Object { - "x": 1593861000000, - "y": null, - }, - Object { - "x": 1593861600000, - "y": null, - }, - Object { - "x": 1593862200000, - "y": null, - }, - Object { - "x": 1593862800000, - "y": null, - }, - Object { - "x": 1593863400000, - "y": null, - }, - Object { - "x": 1593864000000, - "y": null, - }, - Object { - "x": 1593864600000, - "y": null, - }, - Object { - "x": 1593865200000, - "y": null, - }, - Object { - "x": 1593865800000, - "y": null, - }, - Object { - "x": 1593866400000, - "y": null, - }, - Object { - "x": 1593867000000, - "y": null, - }, - Object { - "x": 1593867600000, - "y": null, - }, - Object { - "x": 1593868200000, - "y": null, - }, - Object { - "x": 1593868800000, - "y": null, - }, - Object { - "x": 1593869400000, - "y": null, - }, - Object { - "x": 1593870000000, - "y": null, - }, - Object { - "x": 1593870600000, - "y": null, - }, - Object { - "x": 1593871200000, - "y": null, - }, - Object { - "x": 1593871800000, - "y": null, - }, - Object { - "x": 1593872400000, - "y": null, - }, - Object { - "x": 1593873000000, - "y": null, - }, - Object { - "x": 1593873600000, - "y": null, - }, - Object { - "x": 1593874200000, - "y": null, - }, - Object { - "x": 1593874800000, - "y": null, - }, - Object { - "x": 1593875400000, - "y": null, - }, - Object { - "x": 1593876000000, - "y": null, - }, - Object { - "x": 1593876600000, - "y": null, - }, - Object { - "x": 1593877200000, - "y": null, - }, - Object { - "x": 1593877800000, - "y": null, - }, - Object { - "x": 1593878400000, - "y": null, - }, - Object { - "x": 1593879000000, - "y": null, - }, - Object { - "x": 1593879600000, - "y": null, - }, - Object { - "x": 1593880200000, - "y": null, - }, - Object { - "x": 1593880800000, - "y": null, - }, - Object { - "x": 1593881400000, - "y": null, - }, - Object { - "x": 1593882000000, - "y": null, - }, - Object { - "x": 1593882600000, - "y": null, - }, - Object { - "x": 1593883200000, - "y": null, - }, - Object { - "x": 1593883800000, - "y": null, - }, - Object { - "x": 1593884400000, - "y": null, - }, - Object { - "x": 1593885000000, - "y": null, - }, - Object { - "x": 1593885600000, - "y": null, - }, - Object { - "x": 1593886200000, - "y": null, - }, - Object { - "x": 1593886800000, - "y": null, - }, - Object { - "x": 1593887400000, - "y": null, - }, - Object { - "x": 1593888000000, - "y": null, - }, - Object { - "x": 1593888600000, - "y": 827384, - }, - Object { - "x": 1593889200000, - "y": 2326520, - }, - Object { - "x": 1593889800000, - "y": 1130488, - }, - Object { - "x": 1593890400000, - "y": 1032184, - }, - Object { - "x": 1593891000000, - "y": 770044, - }, - Object { - "x": 1593891600000, - "y": 651256, - }, - Object { - "x": 1593892200000, - "y": 667640, - }, - Object { - "x": 1593892800000, - "y": 708600, - }, - Object { - "x": 1593893400000, - "y": 815096, - }, - Object { - "x": 1593894000000, - "y": 688120, - }, - Object { - "x": 1593894600000, - "y": 978936, - }, - Object { - "x": 1593895200000, - "y": 839672, - }, - Object { - "x": 1593895800000, - "y": 757752, - }, - Object { - "x": 1593896400000, - "y": 577532, - }, - Object { - "x": 1593897000000, - "y": 618488, - }, - Object { - "x": 1593897600000, - "y": 565240, - }, - Object { - "x": 1593898200000, - "y": 618488, - }, - Object { - "x": 1593898800000, - "y": 655352, - }, - Object { - "x": 1593899400000, - "y": 843772, - }, - Object { - "x": 1593900000000, - "y": 831484, - }, - Object { - "x": 1593900600000, - "y": 430076, - }, - Object { - "x": 1593901200000, - "y": 864248, - }, - Object { - "x": 1593901800000, - "y": 655352, - }, - Object { - "x": 1593902400000, - "y": null, - }, - Object { - "x": 1593903000000, - "y": null, - }, - Object { - "x": 1593903600000, - "y": 2883552, - }, - Object { - "x": 1593904200000, - "y": null, - }, - Object { - "x": 1593904800000, - "y": null, - }, - Object { - "x": 1593905400000, - "y": null, - }, - Object { - "x": 1593906000000, - "y": 6094840, - }, - Object { - "x": 1593906600000, - "y": null, - }, - Object { - "x": 1593907200000, - "y": null, - }, - Object { - "x": 1593907800000, - "y": null, - }, - Object { - "x": 1593908400000, - "y": null, - }, - Object { - "x": 1593909000000, - "y": null, - }, - Object { - "x": 1593909600000, - "y": null, - }, - Object { - "x": 1593910200000, - "y": 446336, - }, - Object { - "x": 1593910800000, - "y": null, - }, - Object { - "x": 1593911400000, - "y": null, - }, - Object { - "x": 1593912000000, - "y": null, - }, - Object { - "x": 1593912600000, - "y": null, - }, - Object { - "x": 1593913200000, - "y": null, - }, - Object { - "x": 1593913800000, - "y": null, - }, - Object { - "x": 1593914400000, - "y": null, - }, - Object { - "x": 1593915000000, - "y": null, - }, - Object { - "x": 1593915600000, - "y": null, - }, - Object { - "x": 1593916200000, - "y": null, - }, - Object { - "x": 1593916800000, - "y": 3293168, - }, - Object { - "x": 1593917400000, - "y": null, - }, - Object { - "x": 1593918000000, - "y": null, - }, - Object { - "x": 1593918600000, - "y": null, - }, - Object { - "x": 1593919200000, - "y": null, - }, - Object { - "x": 1593919800000, - "y": null, - }, - Object { - "x": 1593920400000, - "y": null, - }, - Object { - "x": 1593921000000, - "y": null, - }, - Object { - "x": 1593921600000, - "y": null, - }, - Object { - "x": 1593922200000, - "y": null, - }, - Object { - "x": 1593922800000, - "y": null, - }, - Object { - "x": 1593923400000, - "y": 299000, - }, - Object { - "x": 1593924000000, - "y": null, - }, - Object { - "x": 1593924600000, - "y": null, - }, - Object { - "x": 1593925200000, - "y": null, - }, - Object { - "x": 1593925800000, - "y": null, - }, - Object { - "x": 1593926400000, - "y": null, - }, - Object { - "x": 1593927000000, - "y": null, - }, - Object { - "x": 1593927600000, - "y": null, - }, - Object { - "x": 1593928200000, - "y": null, - }, - Object { - "x": 1593928800000, - "y": null, - }, - Object { - "x": 1593929400000, - "y": null, - }, - Object { - "x": 1593930000000, - "y": 5046264, - }, - Object { - "x": 1593930600000, - "y": null, - }, - Object { - "x": 1593931200000, - "y": null, - }, - Object { - "x": 1593931800000, - "y": null, - }, - Object { - "x": 1593932400000, - "y": 4292544, - }, - Object { - "x": 1593933000000, - "y": null, - }, - Object { - "x": 1593933600000, - "y": null, - }, - Object { - "x": 1593934200000, - "y": null, - }, - Object { - "x": 1593934800000, - "y": null, - }, - Object { - "x": 1593935400000, - "y": null, - }, - Object { - "x": 1593936000000, - "y": null, - }, - Object { - "x": 1593936600000, - "y": 5046264, - }, - Object { - "x": 1593937200000, - "y": 4292576, - }, - Object { - "x": 1593937800000, - "y": 4128736, - }, - Object { - "x": 1593938400000, - "y": 843768, - }, - ], - }, - "tpmBuckets": Array [ - Object { - "avg": 1215, - "dataPoints": Array [ - Object { - "x": 1593852000000, - "y": 0, - }, - Object { - "x": 1593852600000, - "y": 0, - }, - Object { - "x": 1593853200000, - "y": 0, - }, - Object { - "x": 1593853800000, - "y": 0, - }, - Object { - "x": 1593854400000, - "y": 0, - }, - Object { - "x": 1593855000000, - "y": 0, - }, - Object { - "x": 1593855600000, - "y": 0, - }, - Object { - "x": 1593856200000, - "y": 0, - }, - Object { - "x": 1593856800000, - "y": 0, - }, - Object { - "x": 1593857400000, - "y": 0, - }, - Object { - "x": 1593858000000, - "y": 0, - }, - Object { - "x": 1593858600000, - "y": 0, - }, - Object { - "x": 1593859200000, - "y": 0, - }, - Object { - "x": 1593859800000, - "y": 0, - }, - Object { - "x": 1593860400000, - "y": 0, - }, - Object { - "x": 1593861000000, - "y": 0, - }, - Object { - "x": 1593861600000, - "y": 0, - }, - Object { - "x": 1593862200000, - "y": 0, - }, - Object { - "x": 1593862800000, - "y": 0, - }, - Object { - "x": 1593863400000, - "y": 0, - }, - Object { - "x": 1593864000000, - "y": 0, - }, - Object { - "x": 1593864600000, - "y": 0, - }, - Object { - "x": 1593865200000, - "y": 0, - }, - Object { - "x": 1593865800000, - "y": 0, - }, - Object { - "x": 1593866400000, - "y": 0, - }, - Object { - "x": 1593867000000, - "y": 0, - }, - Object { - "x": 1593867600000, - "y": 0, - }, - Object { - "x": 1593868200000, - "y": 0, - }, - Object { - "x": 1593868800000, - "y": 0, - }, - Object { - "x": 1593869400000, - "y": 0, - }, - Object { - "x": 1593870000000, - "y": 0, - }, - Object { - "x": 1593870600000, - "y": 0, - }, - Object { - "x": 1593871200000, - "y": 0, - }, - Object { - "x": 1593871800000, - "y": 0, - }, - Object { - "x": 1593872400000, - "y": 0, - }, - Object { - "x": 1593873000000, - "y": 0, - }, - Object { - "x": 1593873600000, - "y": 0, - }, - Object { - "x": 1593874200000, - "y": 0, - }, - Object { - "x": 1593874800000, - "y": 0, - }, - Object { - "x": 1593875400000, - "y": 0, - }, - Object { - "x": 1593876000000, - "y": 0, - }, - Object { - "x": 1593876600000, - "y": 0, - }, - Object { - "x": 1593877200000, - "y": 0, - }, - Object { - "x": 1593877800000, - "y": 0, - }, - Object { - "x": 1593878400000, - "y": 0, - }, - Object { - "x": 1593879000000, - "y": 0, - }, - Object { - "x": 1593879600000, - "y": 0, - }, - Object { - "x": 1593880200000, - "y": 0, - }, - Object { - "x": 1593880800000, - "y": 0, - }, - Object { - "x": 1593881400000, - "y": 0, - }, - Object { - "x": 1593882000000, - "y": 0, - }, - Object { - "x": 1593882600000, - "y": 0, - }, - Object { - "x": 1593883200000, - "y": 0, - }, - Object { - "x": 1593883800000, - "y": 0, - }, - Object { - "x": 1593884400000, - "y": 0, - }, - Object { - "x": 1593885000000, - "y": 0, - }, - Object { - "x": 1593885600000, - "y": 0, - }, - Object { - "x": 1593886200000, - "y": 0, - }, - Object { - "x": 1593886800000, - "y": 0, - }, - Object { - "x": 1593887400000, - "y": 0, - }, - Object { - "x": 1593888000000, - "y": 0, - }, - Object { - "x": 1593888600000, - "y": 84.5, - }, - Object { - "x": 1593889200000, - "y": 222, - }, - Object { - "x": 1593889800000, - "y": 230, - }, - Object { - "x": 1593890400000, - "y": 253, - }, - Object { - "x": 1593891000000, - "y": 239.5, - }, - Object { - "x": 1593891600000, - "y": 228.5, - }, - Object { - "x": 1593892200000, - "y": 257, - }, - Object { - "x": 1593892800000, - "y": 241, - }, - Object { - "x": 1593893400000, - "y": 252, - }, - Object { - "x": 1593894000000, - "y": 266, - }, - Object { - "x": 1593894600000, - "y": 229, - }, - Object { - "x": 1593895200000, - "y": 224, - }, - Object { - "x": 1593895800000, - "y": 234, - }, - Object { - "x": 1593896400000, - "y": 263, - }, - Object { - "x": 1593897000000, - "y": 247.5, - }, - Object { - "x": 1593897600000, - "y": 246, - }, - Object { - "x": 1593898200000, - "y": 243.5, - }, - Object { - "x": 1593898800000, - "y": 245.5, - }, - Object { - "x": 1593899400000, - "y": 243, - }, - Object { - "x": 1593900000000, - "y": 229, - }, - Object { - "x": 1593900600000, - "y": 264, - }, - Object { - "x": 1593901200000, - "y": 233.5, - }, - Object { - "x": 1593901800000, - "y": 89.5, - }, - Object { - "x": 1593902400000, - "y": 0, - }, - Object { - "x": 1593903000000, - "y": 0, - }, - Object { - "x": 1593903600000, - "y": 19.5, - }, - Object { - "x": 1593904200000, - "y": 0, - }, - Object { - "x": 1593904800000, - "y": 0, - }, - Object { - "x": 1593905400000, - "y": 0, - }, - Object { - "x": 1593906000000, - "y": 18, - }, - Object { - "x": 1593906600000, - "y": 0, - }, - Object { - "x": 1593907200000, - "y": 0, - }, - Object { - "x": 1593907800000, - "y": 0, - }, - Object { - "x": 1593908400000, - "y": 0, - }, - Object { - "x": 1593909000000, - "y": 0, - }, - Object { - "x": 1593909600000, - "y": 0, - }, - Object { - "x": 1593910200000, - "y": 17, - }, - Object { - "x": 1593910800000, - "y": 0, - }, - Object { - "x": 1593911400000, - "y": 0, - }, - Object { - "x": 1593912000000, - "y": 0, - }, - Object { - "x": 1593912600000, - "y": 0, - }, - Object { - "x": 1593913200000, - "y": 0, - }, - Object { - "x": 1593913800000, - "y": 0, - }, - Object { - "x": 1593914400000, - "y": 0, - }, - Object { - "x": 1593915000000, - "y": 0, - }, - Object { - "x": 1593915600000, - "y": 0, - }, - Object { - "x": 1593916200000, - "y": 0, - }, - Object { - "x": 1593916800000, - "y": 15.5, - }, - Object { - "x": 1593917400000, - "y": 0, - }, - Object { - "x": 1593918000000, - "y": 0, - }, - Object { - "x": 1593918600000, - "y": 0, - }, - Object { - "x": 1593919200000, - "y": 0, - }, - Object { - "x": 1593919800000, - "y": 0, - }, - Object { - "x": 1593920400000, - "y": 0, - }, - Object { - "x": 1593921000000, - "y": 0, - }, - Object { - "x": 1593921600000, - "y": 0, - }, - Object { - "x": 1593922200000, - "y": 0, - }, - Object { - "x": 1593922800000, - "y": 0, - }, - Object { - "x": 1593923400000, - "y": 24.5, - }, - Object { - "x": 1593924000000, - "y": 0, - }, - Object { - "x": 1593924600000, - "y": 0, - }, - Object { - "x": 1593925200000, - "y": 0, - }, - Object { - "x": 1593925800000, - "y": 0, - }, - Object { - "x": 1593926400000, - "y": 0, - }, - Object { - "x": 1593927000000, - "y": 0, - }, - Object { - "x": 1593927600000, - "y": 0, - }, - Object { - "x": 1593928200000, - "y": 0, - }, - Object { - "x": 1593928800000, - "y": 0, - }, - Object { - "x": 1593929400000, - "y": 0, - }, - Object { - "x": 1593930000000, - "y": 25, - }, - Object { - "x": 1593930600000, - "y": 0, - }, - Object { - "x": 1593931200000, - "y": 0, - }, - Object { - "x": 1593931800000, - "y": 0, - }, - Object { - "x": 1593932400000, - "y": 18.5, - }, - Object { - "x": 1593933000000, - "y": 0, - }, - Object { - "x": 1593933600000, - "y": 0, - }, - Object { - "x": 1593934200000, - "y": 0, - }, - Object { - "x": 1593934800000, - "y": 0, - }, - Object { - "x": 1593935400000, - "y": 0, - }, - Object { - "x": 1593936000000, - "y": 0, - }, - Object { - "x": 1593936600000, - "y": 97, - }, - Object { - "x": 1593937200000, - "y": 192.5, - }, - Object { - "x": 1593937800000, - "y": 210.5, - }, - Object { - "x": 1593938400000, - "y": 172, - }, - ], - "key": "HTTP 2xx", - }, - Object { - "avg": 382.8, - "dataPoints": Array [ - Object { - "x": 1593852000000, - "y": 0, - }, - Object { - "x": 1593852600000, - "y": 0, - }, - Object { - "x": 1593853200000, - "y": 0, - }, - Object { - "x": 1593853800000, - "y": 0, - }, - Object { - "x": 1593854400000, - "y": 0, - }, - Object { - "x": 1593855000000, - "y": 0, - }, - Object { - "x": 1593855600000, - "y": 0, - }, - Object { - "x": 1593856200000, - "y": 0, - }, - Object { - "x": 1593856800000, - "y": 0, - }, - Object { - "x": 1593857400000, - "y": 0, - }, - Object { - "x": 1593858000000, - "y": 0, - }, - Object { - "x": 1593858600000, - "y": 0, - }, - Object { - "x": 1593859200000, - "y": 0, - }, - Object { - "x": 1593859800000, - "y": 0, - }, - Object { - "x": 1593860400000, - "y": 0, - }, - Object { - "x": 1593861000000, - "y": 0, - }, - Object { - "x": 1593861600000, - "y": 0, - }, - Object { - "x": 1593862200000, - "y": 0, - }, - Object { - "x": 1593862800000, - "y": 0, - }, - Object { - "x": 1593863400000, - "y": 0, - }, - Object { - "x": 1593864000000, - "y": 0, - }, - Object { - "x": 1593864600000, - "y": 0, - }, - Object { - "x": 1593865200000, - "y": 0, - }, - Object { - "x": 1593865800000, - "y": 0, - }, - Object { - "x": 1593866400000, - "y": 0, - }, - Object { - "x": 1593867000000, - "y": 0, - }, - Object { - "x": 1593867600000, - "y": 0, - }, - Object { - "x": 1593868200000, - "y": 0, - }, - Object { - "x": 1593868800000, - "y": 0, - }, - Object { - "x": 1593869400000, - "y": 0, - }, - Object { - "x": 1593870000000, - "y": 0, - }, - Object { - "x": 1593870600000, - "y": 0, - }, - Object { - "x": 1593871200000, - "y": 0, - }, - Object { - "x": 1593871800000, - "y": 0, - }, - Object { - "x": 1593872400000, - "y": 0, - }, - Object { - "x": 1593873000000, - "y": 0, - }, - Object { - "x": 1593873600000, - "y": 0, - }, - Object { - "x": 1593874200000, - "y": 0, - }, - Object { - "x": 1593874800000, - "y": 0, - }, - Object { - "x": 1593875400000, - "y": 0, - }, - Object { - "x": 1593876000000, - "y": 0, - }, - Object { - "x": 1593876600000, - "y": 0, - }, - Object { - "x": 1593877200000, - "y": 0, - }, - Object { - "x": 1593877800000, - "y": 0, - }, - Object { - "x": 1593878400000, - "y": 0, - }, - Object { - "x": 1593879000000, - "y": 0, - }, - Object { - "x": 1593879600000, - "y": 0, - }, - Object { - "x": 1593880200000, - "y": 0, - }, - Object { - "x": 1593880800000, - "y": 0, - }, - Object { - "x": 1593881400000, - "y": 0, - }, - Object { - "x": 1593882000000, - "y": 0, - }, - Object { - "x": 1593882600000, - "y": 0, - }, - Object { - "x": 1593883200000, - "y": 0, - }, - Object { - "x": 1593883800000, - "y": 0, - }, - Object { - "x": 1593884400000, - "y": 0, - }, - Object { - "x": 1593885000000, - "y": 0, - }, - Object { - "x": 1593885600000, - "y": 0, - }, - Object { - "x": 1593886200000, - "y": 0, - }, - Object { - "x": 1593886800000, - "y": 0, - }, - Object { - "x": 1593887400000, - "y": 0, - }, - Object { - "x": 1593888000000, - "y": 0, - }, - Object { - "x": 1593888600000, - "y": 31, - }, - Object { - "x": 1593889200000, - "y": 26, - }, - Object { - "x": 1593889800000, - "y": 64, - }, - Object { - "x": 1593890400000, - "y": 71.5, - }, - Object { - "x": 1593891000000, - "y": 64.5, - }, - Object { - "x": 1593891600000, - "y": 60.5, - }, - Object { - "x": 1593892200000, - "y": 146, - }, - Object { - "x": 1593892800000, - "y": 69.5, - }, - Object { - "x": 1593893400000, - "y": 52, - }, - Object { - "x": 1593894000000, - "y": 99, - }, - Object { - "x": 1593894600000, - "y": 89.5, - }, - Object { - "x": 1593895200000, - "y": 58.5, - }, - Object { - "x": 1593895800000, - "y": 91.5, - }, - Object { - "x": 1593896400000, - "y": 132, - }, - Object { - "x": 1593897000000, - "y": 90, - }, - Object { - "x": 1593897600000, - "y": 80, - }, - Object { - "x": 1593898200000, - "y": 104, - }, - Object { - "x": 1593898800000, - "y": 79, - }, - Object { - "x": 1593899400000, - "y": 88, - }, - Object { - "x": 1593900000000, - "y": 91.5, - }, - Object { - "x": 1593900600000, - "y": 117, - }, - Object { - "x": 1593901200000, - "y": 62.5, - }, - Object { - "x": 1593901800000, - "y": 24, - }, - Object { - "x": 1593902400000, - "y": 0, - }, - Object { - "x": 1593903000000, - "y": 0, - }, - Object { - "x": 1593903600000, - "y": 4.5, - }, - Object { - "x": 1593904200000, - "y": 0, - }, - Object { - "x": 1593904800000, - "y": 0, - }, - Object { - "x": 1593905400000, - "y": 0, - }, - Object { - "x": 1593906000000, - "y": 0, - }, - Object { - "x": 1593906600000, - "y": 0, - }, - Object { - "x": 1593907200000, - "y": 0, - }, - Object { - "x": 1593907800000, - "y": 0, - }, - Object { - "x": 1593908400000, - "y": 0, - }, - Object { - "x": 1593909000000, - "y": 0, - }, - Object { - "x": 1593909600000, - "y": 0, - }, - Object { - "x": 1593910200000, - "y": 0, - }, - Object { - "x": 1593910800000, - "y": 0, - }, - Object { - "x": 1593911400000, - "y": 0, - }, - Object { - "x": 1593912000000, - "y": 0, - }, - Object { - "x": 1593912600000, - "y": 0, - }, - Object { - "x": 1593913200000, - "y": 0, - }, - Object { - "x": 1593913800000, - "y": 0, - }, - Object { - "x": 1593914400000, - "y": 0, - }, - Object { - "x": 1593915000000, - "y": 0, - }, - Object { - "x": 1593915600000, - "y": 0, - }, - Object { - "x": 1593916200000, - "y": 0, - }, - Object { - "x": 1593916800000, - "y": 0, - }, - Object { - "x": 1593917400000, - "y": 0, - }, - Object { - "x": 1593918000000, - "y": 0, - }, - Object { - "x": 1593918600000, - "y": 0, - }, - Object { - "x": 1593919200000, - "y": 0, - }, - Object { - "x": 1593919800000, - "y": 0, - }, - Object { - "x": 1593920400000, - "y": 0, - }, - Object { - "x": 1593921000000, - "y": 0, - }, - Object { - "x": 1593921600000, - "y": 0, - }, - Object { - "x": 1593922200000, - "y": 0, - }, - Object { - "x": 1593922800000, - "y": 0, - }, - Object { - "x": 1593923400000, - "y": 5.5, - }, - Object { - "x": 1593924000000, - "y": 0, - }, - Object { - "x": 1593924600000, - "y": 0, - }, - Object { - "x": 1593925200000, - "y": 0, - }, - Object { - "x": 1593925800000, - "y": 0, - }, - Object { - "x": 1593926400000, - "y": 0, - }, - Object { - "x": 1593927000000, - "y": 0, - }, - Object { - "x": 1593927600000, - "y": 0, - }, - Object { - "x": 1593928200000, - "y": 0, - }, - Object { - "x": 1593928800000, - "y": 0, - }, - Object { - "x": 1593929400000, - "y": 0, - }, - Object { - "x": 1593930000000, - "y": 14, - }, - Object { - "x": 1593930600000, - "y": 0, - }, - Object { - "x": 1593931200000, - "y": 0, - }, - Object { - "x": 1593931800000, - "y": 0, - }, - Object { - "x": 1593932400000, - "y": 1, - }, - Object { - "x": 1593933000000, - "y": 0, - }, - Object { - "x": 1593933600000, - "y": 0, - }, - Object { - "x": 1593934200000, - "y": 0, - }, - Object { - "x": 1593934800000, - "y": 0, - }, - Object { - "x": 1593935400000, - "y": 0, - }, - Object { - "x": 1593936000000, - "y": 0, - }, - Object { - "x": 1593936600000, - "y": 0, - }, - Object { - "x": 1593937200000, - "y": 31.5, - }, - Object { - "x": 1593937800000, - "y": 25, - }, - Object { - "x": 1593938400000, - "y": 41, - }, - ], - "key": "HTTP 3xx", - }, - Object { - "avg": 68.3, - "dataPoints": Array [ - Object { - "x": 1593852000000, - "y": 0, - }, - Object { - "x": 1593852600000, - "y": 0, - }, - Object { - "x": 1593853200000, - "y": 0, - }, - Object { - "x": 1593853800000, - "y": 0, - }, - Object { - "x": 1593854400000, - "y": 0, - }, - Object { - "x": 1593855000000, - "y": 0, - }, - Object { - "x": 1593855600000, - "y": 0, - }, - Object { - "x": 1593856200000, - "y": 0, - }, - Object { - "x": 1593856800000, - "y": 0, - }, - Object { - "x": 1593857400000, - "y": 0, - }, - Object { - "x": 1593858000000, - "y": 0, - }, - Object { - "x": 1593858600000, - "y": 0, - }, - Object { - "x": 1593859200000, - "y": 0, - }, - Object { - "x": 1593859800000, - "y": 0, - }, - Object { - "x": 1593860400000, - "y": 0, - }, - Object { - "x": 1593861000000, - "y": 0, - }, - Object { - "x": 1593861600000, - "y": 0, - }, - Object { - "x": 1593862200000, - "y": 0, - }, - Object { - "x": 1593862800000, - "y": 0, - }, - Object { - "x": 1593863400000, - "y": 0, - }, - Object { - "x": 1593864000000, - "y": 0, - }, - Object { - "x": 1593864600000, - "y": 0, - }, - Object { - "x": 1593865200000, - "y": 0, - }, - Object { - "x": 1593865800000, - "y": 0, - }, - Object { - "x": 1593866400000, - "y": 0, - }, - Object { - "x": 1593867000000, - "y": 0, - }, - Object { - "x": 1593867600000, - "y": 0, - }, - Object { - "x": 1593868200000, - "y": 0, - }, - Object { - "x": 1593868800000, - "y": 0, - }, - Object { - "x": 1593869400000, - "y": 0, - }, - Object { - "x": 1593870000000, - "y": 0, - }, - Object { - "x": 1593870600000, - "y": 0, - }, - Object { - "x": 1593871200000, - "y": 0, - }, - Object { - "x": 1593871800000, - "y": 0, - }, - Object { - "x": 1593872400000, - "y": 0, - }, - Object { - "x": 1593873000000, - "y": 0, - }, - Object { - "x": 1593873600000, - "y": 0, - }, - Object { - "x": 1593874200000, - "y": 0, - }, - Object { - "x": 1593874800000, - "y": 0, - }, - Object { - "x": 1593875400000, - "y": 0, - }, - Object { - "x": 1593876000000, - "y": 0, - }, - Object { - "x": 1593876600000, - "y": 0, - }, - Object { - "x": 1593877200000, - "y": 0, - }, - Object { - "x": 1593877800000, - "y": 0, - }, - Object { - "x": 1593878400000, - "y": 0, - }, - Object { - "x": 1593879000000, - "y": 0, - }, - Object { - "x": 1593879600000, - "y": 0, - }, - Object { - "x": 1593880200000, - "y": 0, - }, - Object { - "x": 1593880800000, - "y": 0, - }, - Object { - "x": 1593881400000, - "y": 0, - }, - Object { - "x": 1593882000000, - "y": 0, - }, - Object { - "x": 1593882600000, - "y": 0, - }, - Object { - "x": 1593883200000, - "y": 0, - }, - Object { - "x": 1593883800000, - "y": 0, - }, - Object { - "x": 1593884400000, - "y": 0, - }, - Object { - "x": 1593885000000, - "y": 0, - }, - Object { - "x": 1593885600000, - "y": 0, - }, - Object { - "x": 1593886200000, - "y": 0, - }, - Object { - "x": 1593886800000, - "y": 0, - }, - Object { - "x": 1593887400000, - "y": 0, - }, - Object { - "x": 1593888000000, - "y": 0, - }, - Object { - "x": 1593888600000, - "y": 5.5, - }, - Object { - "x": 1593889200000, - "y": 15.5, - }, - Object { - "x": 1593889800000, - "y": 9.5, - }, - Object { - "x": 1593890400000, - "y": 11.5, - }, - Object { - "x": 1593891000000, - "y": 13, - }, - Object { - "x": 1593891600000, - "y": 13.5, - }, - Object { - "x": 1593892200000, - "y": 13.5, - }, - Object { - "x": 1593892800000, - "y": 15, - }, - Object { - "x": 1593893400000, - "y": 14, - }, - Object { - "x": 1593894000000, - "y": 16.5, - }, - Object { - "x": 1593894600000, - "y": 11.5, - }, - Object { - "x": 1593895200000, - "y": 17.5, - }, - Object { - "x": 1593895800000, - "y": 13, - }, - Object { - "x": 1593896400000, - "y": 17.5, - }, - Object { - "x": 1593897000000, - "y": 12.5, - }, - Object { - "x": 1593897600000, - "y": 13, - }, - Object { - "x": 1593898200000, - "y": 12.5, - }, - Object { - "x": 1593898800000, - "y": 8.5, - }, - Object { - "x": 1593899400000, - "y": 9.5, - }, - Object { - "x": 1593900000000, - "y": 14, - }, - Object { - "x": 1593900600000, - "y": 12, - }, - Object { - "x": 1593901200000, - "y": 15, - }, - Object { - "x": 1593901800000, - "y": 3, - }, - Object { - "x": 1593902400000, - "y": 0, - }, - Object { - "x": 1593903000000, - "y": 0, - }, - Object { - "x": 1593903600000, - "y": 1, - }, - Object { - "x": 1593904200000, - "y": 0, - }, - Object { - "x": 1593904800000, - "y": 0, - }, - Object { - "x": 1593905400000, - "y": 0, - }, - Object { - "x": 1593906000000, - "y": 2, - }, - Object { - "x": 1593906600000, - "y": 0, - }, - Object { - "x": 1593907200000, - "y": 0, - }, - Object { - "x": 1593907800000, - "y": 0, - }, - Object { - "x": 1593908400000, - "y": 0, - }, - Object { - "x": 1593909000000, - "y": 0, - }, - Object { - "x": 1593909600000, - "y": 0, - }, - Object { - "x": 1593910200000, - "y": 0, - }, - Object { - "x": 1593910800000, - "y": 0, - }, - Object { - "x": 1593911400000, - "y": 0, - }, - Object { - "x": 1593912000000, - "y": 0, - }, - Object { - "x": 1593912600000, - "y": 0, - }, - Object { - "x": 1593913200000, - "y": 0, - }, - Object { - "x": 1593913800000, - "y": 0, - }, - Object { - "x": 1593914400000, - "y": 0, - }, - Object { - "x": 1593915000000, - "y": 0, - }, - Object { - "x": 1593915600000, - "y": 0, - }, - Object { - "x": 1593916200000, - "y": 0, - }, - Object { - "x": 1593916800000, - "y": 1.5, - }, - Object { - "x": 1593917400000, - "y": 0, - }, - Object { - "x": 1593918000000, - "y": 0, - }, - Object { - "x": 1593918600000, - "y": 0, - }, - Object { - "x": 1593919200000, - "y": 0, - }, - Object { - "x": 1593919800000, - "y": 0, - }, - Object { - "x": 1593920400000, - "y": 0, - }, - Object { - "x": 1593921000000, - "y": 0, - }, - Object { - "x": 1593921600000, - "y": 0, - }, - Object { - "x": 1593922200000, - "y": 0, - }, - Object { - "x": 1593922800000, - "y": 0, - }, - Object { - "x": 1593923400000, - "y": 1, - }, - Object { - "x": 1593924000000, - "y": 0, - }, - Object { - "x": 1593924600000, - "y": 0, - }, - Object { - "x": 1593925200000, - "y": 0, - }, - Object { - "x": 1593925800000, - "y": 0, - }, - Object { - "x": 1593926400000, - "y": 0, - }, - Object { - "x": 1593927000000, - "y": 0, - }, - Object { - "x": 1593927600000, - "y": 0, - }, - Object { - "x": 1593928200000, - "y": 0, - }, - Object { - "x": 1593928800000, - "y": 0, - }, - Object { - "x": 1593929400000, - "y": 0, - }, - Object { - "x": 1593930000000, - "y": 1.5, - }, - Object { - "x": 1593930600000, - "y": 0, - }, - Object { - "x": 1593931200000, - "y": 0, - }, - Object { - "x": 1593931800000, - "y": 0, - }, - Object { - "x": 1593932400000, - "y": 1, - }, - Object { - "x": 1593933000000, - "y": 0, - }, - Object { - "x": 1593933600000, - "y": 0, - }, - Object { - "x": 1593934200000, - "y": 0, - }, - Object { - "x": 1593934800000, - "y": 0, - }, - Object { - "x": 1593935400000, - "y": 0, - }, - Object { - "x": 1593936000000, - "y": 0, - }, - Object { - "x": 1593936600000, - "y": 7.5, - }, - Object { - "x": 1593937200000, - "y": 14.5, - }, - Object { - "x": 1593937800000, - "y": 15.5, - }, - Object { - "x": 1593938400000, - "y": 9, - }, - ], - "key": "HTTP 4xx", - }, - Object { - "avg": 37.8, - "dataPoints": Array [ - Object { - "x": 1593852000000, - "y": 0, - }, - Object { - "x": 1593852600000, - "y": 0, - }, - Object { - "x": 1593853200000, - "y": 0, - }, - Object { - "x": 1593853800000, - "y": 0, - }, - Object { - "x": 1593854400000, - "y": 0, - }, - Object { - "x": 1593855000000, - "y": 0, - }, - Object { - "x": 1593855600000, - "y": 0, - }, - Object { - "x": 1593856200000, - "y": 0, - }, - Object { - "x": 1593856800000, - "y": 0, - }, - Object { - "x": 1593857400000, - "y": 0, - }, - Object { - "x": 1593858000000, - "y": 0, - }, - Object { - "x": 1593858600000, - "y": 0, - }, - Object { - "x": 1593859200000, - "y": 0, - }, - Object { - "x": 1593859800000, - "y": 0, - }, - Object { - "x": 1593860400000, - "y": 0, - }, - Object { - "x": 1593861000000, - "y": 0, - }, - Object { - "x": 1593861600000, - "y": 0, - }, - Object { - "x": 1593862200000, - "y": 0, - }, - Object { - "x": 1593862800000, - "y": 0, - }, - Object { - "x": 1593863400000, - "y": 0, - }, - Object { - "x": 1593864000000, - "y": 0, - }, - Object { - "x": 1593864600000, - "y": 0, - }, - Object { - "x": 1593865200000, - "y": 0, - }, - Object { - "x": 1593865800000, - "y": 0, - }, - Object { - "x": 1593866400000, - "y": 0, - }, - Object { - "x": 1593867000000, - "y": 0, - }, - Object { - "x": 1593867600000, - "y": 0, - }, - Object { - "x": 1593868200000, - "y": 0, - }, - Object { - "x": 1593868800000, - "y": 0, - }, - Object { - "x": 1593869400000, - "y": 0, - }, - Object { - "x": 1593870000000, - "y": 0, - }, - Object { - "x": 1593870600000, - "y": 0, - }, - Object { - "x": 1593871200000, - "y": 0, - }, - Object { - "x": 1593871800000, - "y": 0, - }, - Object { - "x": 1593872400000, - "y": 0, - }, - Object { - "x": 1593873000000, - "y": 0, - }, - Object { - "x": 1593873600000, - "y": 0, - }, - Object { - "x": 1593874200000, - "y": 0, - }, - Object { - "x": 1593874800000, - "y": 0, - }, - Object { - "x": 1593875400000, - "y": 0, - }, - Object { - "x": 1593876000000, - "y": 0, - }, - Object { - "x": 1593876600000, - "y": 0, - }, - Object { - "x": 1593877200000, - "y": 0, - }, - Object { - "x": 1593877800000, - "y": 0, - }, - Object { - "x": 1593878400000, - "y": 0, - }, - Object { - "x": 1593879000000, - "y": 0, - }, - Object { - "x": 1593879600000, - "y": 0, - }, - Object { - "x": 1593880200000, - "y": 0, - }, - Object { - "x": 1593880800000, - "y": 0, - }, - Object { - "x": 1593881400000, - "y": 0, - }, - Object { - "x": 1593882000000, - "y": 0, - }, - Object { - "x": 1593882600000, - "y": 0, - }, - Object { - "x": 1593883200000, - "y": 0, - }, - Object { - "x": 1593883800000, - "y": 0, - }, - Object { - "x": 1593884400000, - "y": 0, - }, - Object { - "x": 1593885000000, - "y": 0, - }, - Object { - "x": 1593885600000, - "y": 0, - }, - Object { - "x": 1593886200000, - "y": 0, - }, - Object { - "x": 1593886800000, - "y": 0, - }, - Object { - "x": 1593887400000, - "y": 0, - }, - Object { - "x": 1593888000000, - "y": 0, - }, - Object { - "x": 1593888600000, - "y": 2.5, - }, - Object { - "x": 1593889200000, - "y": 7.5, - }, - Object { - "x": 1593889800000, - "y": 6, - }, - Object { - "x": 1593890400000, - "y": 8, - }, - Object { - "x": 1593891000000, - "y": 6, - }, - Object { - "x": 1593891600000, - "y": 8, - }, - Object { - "x": 1593892200000, - "y": 11.5, - }, - Object { - "x": 1593892800000, - "y": 5, - }, - Object { - "x": 1593893400000, - "y": 5, - }, - Object { - "x": 1593894000000, - "y": 9, - }, - Object { - "x": 1593894600000, - "y": 5, - }, - Object { - "x": 1593895200000, - "y": 8.5, - }, - Object { - "x": 1593895800000, - "y": 6.5, - }, - Object { - "x": 1593896400000, - "y": 9, - }, - Object { - "x": 1593897000000, - "y": 8.5, - }, - Object { - "x": 1593897600000, - "y": 8.5, - }, - Object { - "x": 1593898200000, - "y": 5.5, - }, - Object { - "x": 1593898800000, - "y": 5, - }, - Object { - "x": 1593899400000, - "y": 9, - }, - Object { - "x": 1593900000000, - "y": 8, - }, - Object { - "x": 1593900600000, - "y": 6, - }, - Object { - "x": 1593901200000, - "y": 9, - }, - Object { - "x": 1593901800000, - "y": 4, - }, - Object { - "x": 1593902400000, - "y": 0, - }, - Object { - "x": 1593903000000, - "y": 0, - }, - Object { - "x": 1593903600000, - "y": 0, - }, - Object { - "x": 1593904200000, - "y": 0, - }, - Object { - "x": 1593904800000, - "y": 0, - }, - Object { - "x": 1593905400000, - "y": 0, - }, - Object { - "x": 1593906000000, - "y": 0.5, - }, - Object { - "x": 1593906600000, - "y": 0, - }, - Object { - "x": 1593907200000, - "y": 0, - }, - Object { - "x": 1593907800000, - "y": 0, - }, - Object { - "x": 1593908400000, - "y": 0, - }, - Object { - "x": 1593909000000, - "y": 0, - }, - Object { - "x": 1593909600000, - "y": 0, - }, - Object { - "x": 1593910200000, - "y": 1.5, - }, - Object { - "x": 1593910800000, - "y": 0, - }, - Object { - "x": 1593911400000, - "y": 0, - }, - Object { - "x": 1593912000000, - "y": 0, - }, - Object { - "x": 1593912600000, - "y": 0, - }, - Object { - "x": 1593913200000, - "y": 0, - }, - Object { - "x": 1593913800000, - "y": 0, - }, - Object { - "x": 1593914400000, - "y": 0, - }, - Object { - "x": 1593915000000, - "y": 0, - }, - Object { - "x": 1593915600000, - "y": 0, - }, - Object { - "x": 1593916200000, - "y": 0, - }, - Object { - "x": 1593916800000, - "y": 1.5, - }, - Object { - "x": 1593917400000, - "y": 0, - }, - Object { - "x": 1593918000000, - "y": 0, - }, - Object { - "x": 1593918600000, - "y": 0, - }, - Object { - "x": 1593919200000, - "y": 0, - }, - Object { - "x": 1593919800000, - "y": 0, - }, - Object { - "x": 1593920400000, - "y": 0, - }, - Object { - "x": 1593921000000, - "y": 0, - }, - Object { - "x": 1593921600000, - "y": 0, - }, - Object { - "x": 1593922200000, - "y": 0, - }, - Object { - "x": 1593922800000, - "y": 0, - }, - Object { - "x": 1593923400000, - "y": 1, - }, - Object { - "x": 1593924000000, - "y": 0, - }, - Object { - "x": 1593924600000, - "y": 0, - }, - Object { - "x": 1593925200000, - "y": 0, - }, - Object { - "x": 1593925800000, - "y": 0, - }, - Object { - "x": 1593926400000, - "y": 0, - }, - Object { - "x": 1593927000000, - "y": 0, - }, - Object { - "x": 1593927600000, - "y": 0, - }, - Object { - "x": 1593928200000, - "y": 0, - }, - Object { - "x": 1593928800000, - "y": 0, - }, - Object { - "x": 1593929400000, - "y": 0, - }, - Object { - "x": 1593930000000, - "y": 1, - }, - Object { - "x": 1593930600000, - "y": 0, - }, - Object { - "x": 1593931200000, - "y": 0, - }, - Object { - "x": 1593931800000, - "y": 0, - }, - Object { - "x": 1593932400000, - "y": 0.5, - }, - Object { - "x": 1593933000000, - "y": 0, - }, - Object { - "x": 1593933600000, - "y": 0, - }, - Object { - "x": 1593934200000, - "y": 0, - }, - Object { - "x": 1593934800000, - "y": 0, - }, - Object { - "x": 1593935400000, - "y": 0, - }, - Object { - "x": 1593936000000, - "y": 0, - }, - Object { - "x": 1593936600000, - "y": 3, - }, - Object { - "x": 1593937200000, - "y": 8.5, - }, - Object { - "x": 1593937800000, - "y": 8, - }, - Object { - "x": 1593938400000, - "y": 2.5, - }, - ], - "key": "HTTP 5xx", - }, - Object { - "avg": 0, - "dataPoints": Array [], - "key": "A Custom Bucket (that should be last)", - }, - ], -} -`; diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.test.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.test.ts deleted file mode 100644 index 75dfae3e7375f..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.test.ts +++ /dev/null @@ -1,69 +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 { ESResponse, timeseriesFetcher } from './fetcher'; -import { APMConfig } from '../../../../../server'; -import { ProcessorEvent } from '../../../../../common/processor_event'; - -describe('timeseriesFetcher', () => { - let res: ESResponse; - let clientSpy: jest.Mock; - beforeEach(async () => { - clientSpy = jest.fn().mockResolvedValueOnce('ES response'); - - res = await timeseriesFetcher({ - serviceName: 'myServiceName', - transactionType: 'myTransactionType', - transactionName: undefined, - setup: { - start: 1528113600000, - end: 1528977600000, - apmEventClient: { search: clientSpy } as any, - internalClient: { search: clientSpy } as any, - config: new Proxy( - {}, - { - get: () => 'myIndex', - } - ) as APMConfig, - uiFilters: { - environment: 'test', - }, - esFilter: [ - { - term: { 'service.environment': 'test' }, - }, - ], - indices: { - /* eslint-disable @typescript-eslint/naming-convention */ - 'apm_oss.sourcemapIndices': 'myIndex', - 'apm_oss.errorIndices': 'myIndex', - 'apm_oss.onboardingIndices': 'myIndex', - 'apm_oss.spanIndices': 'myIndex', - 'apm_oss.transactionIndices': 'myIndex', - 'apm_oss.metricsIndices': 'myIndex', - /* eslint-enable @typescript-eslint/naming-convention */ - apmAgentConfigurationIndex: 'myIndex', - apmCustomLinkIndex: 'myIndex', - }, - }, - searchAggregatedTransactions: false, - }); - }); - - it('should call client with correct query', () => { - expect(clientSpy.mock.calls).toMatchSnapshot(); - }); - - it('should restrict results to only transaction documents', () => { - const query = clientSpy.mock.calls[0][0]; - expect(query.apm.events).toEqual([ProcessorEvent.transaction]); - }); - - it('should return correct response', () => { - expect(res).toBe('ES response'); - }); -}); diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/index.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/index.ts deleted file mode 100644 index 6c923290848a1..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/index.ts +++ /dev/null @@ -1,29 +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 { getBucketSize } from '../../../helpers/get_bucket_size'; -import { Setup, SetupTimeRange } from '../../../helpers/setup_request'; -import { timeseriesFetcher } from './fetcher'; -import { timeseriesTransformer } from './transform'; - -export async function getApmTimeseriesData(options: { - serviceName: string; - transactionType: string | undefined; - transactionName: string | undefined; - setup: Setup & SetupTimeRange; - searchAggregatedTransactions: boolean; -}) { - const { start, end } = options.setup; - const { bucketSize } = getBucketSize({ start, end }); - const durationAsMinutes = (end - start) / 1000 / 60; - - const timeseriesResponse = await timeseriesFetcher(options); - return timeseriesTransformer({ - timeseriesResponse, - bucketSize, - durationAsMinutes, - }); -} diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.test.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.test.ts index bda3bfcdf769c..e4baf69eb0263 100644 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.test.ts +++ b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.test.ts @@ -4,150 +4,156 @@ * you may not use this file except in compliance with the Elastic License. */ -import { timeseriesResponse } from './mock_responses/timeseries_response'; -import { - ApmTimeSeriesResponse, - getTpmBuckets, - timeseriesTransformer, -} from './transform'; +// /* +// * 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. +// */ -describe('timeseriesTransformer', () => { - let res: ApmTimeSeriesResponse; - beforeEach(async () => { - res = await timeseriesTransformer({ - timeseriesResponse, - bucketSize: 120, - durationAsMinutes: 10, - }); - }); +// import { timeseriesResponse } from './mock_responses/timeseries_response'; +// import { +// ApmTimeSeriesResponse, +// getThroughputBuckets, +// timeseriesTransformer, +// } from './transform'; - it('should have correct order', () => { - expect(res.tpmBuckets.map((bucket) => bucket.key)).toEqual([ - 'HTTP 2xx', - 'HTTP 3xx', - 'HTTP 4xx', - 'HTTP 5xx', - 'A Custom Bucket (that should be last)', - ]); - }); +// describe('timeseriesTransformer', () => { +// let res: ApmTimeSeriesResponse; +// beforeEach(async () => { +// res = await timeseriesTransformer({ +// timeseriesResponse, +// bucketSize: 120, +// durationAsMinutes: 10, +// }); +// }); - it('should match snapshot', () => { - expect(res).toMatchSnapshot(); - }); -}); +// it('should have correct order', () => { +// expect(res.tpmBuckets.map((bucket) => bucket.key)).toEqual([ +// 'HTTP 2xx', +// 'HTTP 3xx', +// 'HTTP 4xx', +// 'HTTP 5xx', +// 'A Custom Bucket (that should be last)', +// ]); +// }); -describe('getTpmBuckets', () => { - it('should return response', () => { - const buckets = [ - { - key: 'HTTP 4xx', - doc_count: 300, - timeseries: { - buckets: [ - { - key_as_string: '', - key: 0, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '', - key: 1, - doc_count: 200, - count: { - value: 200, - }, - }, - { - key_as_string: '', - key: 2, - doc_count: 300, - count: { - value: 300, - }, - }, - { - key_as_string: '', - key: 3, - doc_count: 400, - count: { - value: 400, - }, - }, - ], - }, - }, - { - key: 'HTTP 5xx', - doc_count: 400, - timeseries: { - buckets: [ - { - key_as_string: '', - key: 0, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '', - key: 1, - doc_count: 100, - count: { - value: 100, - }, - }, - { - key_as_string: '', - key: 2, - doc_count: 100, - count: { - value: 100, - }, - }, - { - key_as_string: '', - key: 3, - doc_count: 300, - count: { - value: 300, - }, - }, - ], - }, - }, - ]; +// it('should match snapshot', () => { +// expect(res).toMatchSnapshot(); +// }); +// }); - expect( - getTpmBuckets({ - transactionResultBuckets: buckets, - bucketSize: 120, - durationAsMinutes: 10, - }) - ).toEqual([ - { - avg: 90, - dataPoints: [ - { x: 0, y: 0 }, - { x: 1, y: 100 }, - { x: 2, y: 150 }, - { x: 3, y: 200 }, - ], - key: 'HTTP 4xx', - }, - { - avg: 50, - dataPoints: [ - { x: 0, y: 0 }, - { x: 1, y: 50 }, - { x: 2, y: 50 }, - { x: 3, y: 150 }, - ], - key: 'HTTP 5xx', - }, - ]); - }); -}); +// describe('getThroughputBuckets', () => { +// it('should return response', () => { +// const buckets = [ +// { +// key: 'HTTP 4xx', +// doc_count: 300, +// timeseries: { +// buckets: [ +// { +// key_as_string: '', +// key: 0, +// doc_count: 0, +// count: { +// value: 0, +// }, +// }, +// { +// key_as_string: '', +// key: 1, +// doc_count: 200, +// count: { +// value: 200, +// }, +// }, +// { +// key_as_string: '', +// key: 2, +// doc_count: 300, +// count: { +// value: 300, +// }, +// }, +// { +// key_as_string: '', +// key: 3, +// doc_count: 400, +// count: { +// value: 400, +// }, +// }, +// ], +// }, +// }, +// { +// key: 'HTTP 5xx', +// doc_count: 400, +// timeseries: { +// buckets: [ +// { +// key_as_string: '', +// key: 0, +// doc_count: 0, +// count: { +// value: 0, +// }, +// }, +// { +// key_as_string: '', +// key: 1, +// doc_count: 100, +// count: { +// value: 100, +// }, +// }, +// { +// key_as_string: '', +// key: 2, +// doc_count: 100, +// count: { +// value: 100, +// }, +// }, +// { +// key_as_string: '', +// key: 3, +// doc_count: 300, +// count: { +// value: 300, +// }, +// }, +// ], +// }, +// }, +// ]; + +// expect( +// getThroughputBuckets({ +// transactionResultBuckets: buckets, +// bucketSize: 120, +// durationAsMinutes: 10, +// }) +// ).toEqual([ +// { +// avg: 90, +// dataPoints: [ +// { x: 0, y: 0 }, +// { x: 1, y: 100 }, +// { x: 2, y: 150 }, +// { x: 3, y: 200 }, +// ], +// key: 'HTTP 4xx', +// }, +// { +// avg: 50, +// dataPoints: [ +// { x: 0, y: 0 }, +// { x: 1, y: 50 }, +// { x: 2, y: 50 }, +// { x: 3, y: 150 }, +// ], +// key: 'HTTP 5xx', +// }, +// ]); +// }); +// }); diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts deleted file mode 100644 index eecb3e7177ef6..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts +++ /dev/null @@ -1,105 +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 { isNumber, sortBy } from 'lodash'; -import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n'; -import { Coordinate } from '../../../../../typings/timeseries'; -import { ESResponse } from './fetcher'; - -export type ApmTimeSeriesResponse = ReturnType; - -export function timeseriesTransformer({ - timeseriesResponse, - bucketSize, - durationAsMinutes, -}: { - timeseriesResponse: ESResponse; - bucketSize: number; - durationAsMinutes: number; -}) { - const aggs = timeseriesResponse.aggregations; - const overallAvgDuration = aggs?.overall_avg_duration.value || null; - const responseTimeBuckets = aggs?.response_times.buckets || []; - const { avg, p95, p99 } = getResponseTime(responseTimeBuckets); - const transactionResultBuckets = aggs?.transaction_results.buckets || []; - const tpmBuckets = getTpmBuckets({ - transactionResultBuckets, - bucketSize, - durationAsMinutes, - }); - - return { - responseTimes: { - avg, - p95, - p99, - }, - tpmBuckets, - overallAvgDuration, - }; -} - -type TransactionResultBuckets = Required['aggregations']['transaction_results']['buckets']; - -export function getTpmBuckets({ - transactionResultBuckets = [], - bucketSize, - durationAsMinutes, -}: { - transactionResultBuckets: TransactionResultBuckets; - bucketSize: number; - durationAsMinutes: number; -}) { - const buckets = transactionResultBuckets.map( - ({ key: resultKey, timeseries }) => { - const dataPoints = timeseries.buckets.map((bucket) => { - return { - x: bucket.key, - // divide by minutes - y: bucket.count.value / (bucketSize / 60), - }; - }); - - // Handle empty string result keys - const key = - resultKey === '' ? NOT_AVAILABLE_LABEL : (resultKey as string); - - const docCountTotal = timeseries.buckets - .map((bucket) => bucket.count.value) - .reduce((a, b) => a + b, 0); - - // calculate request/minute - const avg = docCountTotal / durationAsMinutes; - - return { key, dataPoints, avg }; - } - ); - - return sortBy( - buckets, - (bucket) => bucket.key.toString().replace(/^HTTP (\d)xx$/, '00$1') // ensure that HTTP 3xx are sorted at the top - ); -} - -type ResponseTimeBuckets = Required['aggregations']['response_times']['buckets']; - -function getResponseTime(responseTimeBuckets: ResponseTimeBuckets = []) { - return responseTimeBuckets.reduce( - (acc, bucket) => { - const { '95.0': p95, '99.0': p99 } = bucket.pct.values; - - acc.avg.push({ x: bucket.key, y: bucket.avg.value }); - acc.p95.push({ x: bucket.key, y: isNumber(p95) ? p95 : null }); - acc.p99.push({ x: bucket.key, y: isNumber(p99) ? p99 : null }); - return acc; - }, - { - avg: [] as Coordinate[], - p95: [] as Coordinate[], - p99: [] as Coordinate[], - } - ); -} diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/index.ts b/x-pack/plugins/apm/server/lib/transactions/charts/index.ts deleted file mode 100644 index d8593612c0582..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/charts/index.ts +++ /dev/null @@ -1,39 +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 { Logger } from 'kibana/server'; -import { PromiseReturnType } from '../../../../../observability/typings/common'; -import { Setup, SetupTimeRange } from '../../helpers/setup_request'; -import { getAnomalySeries } from './get_anomaly_data'; -import { getApmTimeseriesData } from './get_timeseries_data'; -import { ApmTimeSeriesResponse } from './get_timeseries_data/transform'; - -function getDates(apmTimeseries: ApmTimeSeriesResponse) { - return apmTimeseries.responseTimes.avg.map((p) => p.x); -} - -export type TimeSeriesAPIResponse = PromiseReturnType< - typeof getTransactionCharts ->; -export async function getTransactionCharts(options: { - serviceName: string; - transactionType: string | undefined; - transactionName: string | undefined; - setup: Setup & SetupTimeRange; - searchAggregatedTransactions: boolean; - logger: Logger; -}) { - const apmTimeseries = await getApmTimeseriesData(options); - const anomalyTimeseries = await getAnomalySeries({ - ...options, - timeSeriesDates: getDates(apmTimeseries), - }); - - return { - apmTimeseries, - anomalyTimeseries, - }; -} diff --git a/x-pack/plugins/apm/server/lib/transactions/queries.test.ts b/x-pack/plugins/apm/server/lib/transactions/queries.test.ts index eff9451c9e1cd..c903f7daf2b91 100644 --- a/x-pack/plugins/apm/server/lib/transactions/queries.test.ts +++ b/x-pack/plugins/apm/server/lib/transactions/queries.test.ts @@ -4,16 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getTransactionBreakdown } from './breakdown'; -import { getTransactionCharts } from './charts'; -import { getTransactionDistribution } from './distribution'; -import { getTransaction } from './get_transaction'; import { - SearchParamsMock, inspectSearchParams, + SearchParamsMock, } from '../../utils/test_helpers'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { loggerMock } from '../../../../../../src/core/server/logging/logger.mock'; +import { getTransactionBreakdown } from './breakdown'; +import { getTransactionDistribution } from './distribution'; +import { getTransaction } from './get_transaction'; describe('transaction queries', () => { let mock: SearchParamsMock; @@ -47,49 +44,6 @@ describe('transaction queries', () => { expect(mock.params).toMatchSnapshot(); }); - it('fetches transaction charts', async () => { - mock = await inspectSearchParams((setup) => - getTransactionCharts({ - serviceName: 'foo', - transactionName: undefined, - transactionType: undefined, - setup, - searchAggregatedTransactions: false, - logger: loggerMock.create(), - }) - ); - expect(mock.params).toMatchSnapshot(); - }); - - it('fetches transaction charts for a transaction type', async () => { - mock = await inspectSearchParams((setup) => - getTransactionCharts({ - serviceName: 'foo', - transactionName: 'bar', - transactionType: undefined, - setup, - searchAggregatedTransactions: false, - logger: loggerMock.create(), - }) - ); - expect(mock.params).toMatchSnapshot(); - }); - - it('fetches transaction charts for a transaction type and transaction name', async () => { - mock = await inspectSearchParams((setup) => - getTransactionCharts({ - serviceName: 'foo', - transactionName: 'bar', - transactionType: 'baz', - setup, - searchAggregatedTransactions: false, - logger: loggerMock.create(), - }) - ); - - expect(mock.params).toMatchSnapshot(); - }); - it('fetches transaction distribution', async () => { mock = await inspectSearchParams((setup) => getTransactionDistribution({ diff --git a/x-pack/plugins/apm/server/routes/create_apm_api.ts b/x-pack/plugins/apm/server/routes/create_apm_api.ts index 0e066a1959c49..7e2155cf3895d 100644 --- a/x-pack/plugins/apm/server/routes/create_apm_api.ts +++ b/x-pack/plugins/apm/server/routes/create_apm_api.ts @@ -52,11 +52,12 @@ import { } from './correlations'; import { transactionChartsBreakdownRoute, - transactionChartsRoute, transactionChartsDistributionRoute, transactionChartsErrorRateRoute, transactionGroupsRoute, transactionGroupsOverviewRoute, + transactionLatencyChatsRoute, + transactionThroughputChatsRoute, } from './transactions/transactions_routes'; import { errorGroupsLocalFiltersRoute, @@ -152,11 +153,12 @@ const createApmApi = () => { // Transactions .add(transactionChartsBreakdownRoute) - .add(transactionChartsRoute) .add(transactionChartsDistributionRoute) .add(transactionChartsErrorRateRoute) .add(transactionGroupsRoute) .add(transactionGroupsOverviewRoute) + .add(transactionLatencyChatsRoute) + .add(transactionThroughputChatsRoute) // UI filters .add(errorGroupsLocalFiltersRoute) diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts similarity index 52% rename from x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts rename to x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts index cffec688806b5..fd5090f9e4f48 100644 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/fetcher.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts @@ -3,26 +3,26 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ - -import { ESFilter } from '../../../../../../../typings/elasticsearch'; -import { PromiseReturnType } from '../../../../../../observability/typings/common'; +import { ESFilter } from '../../../../../../typings/elasticsearch'; +import { PromiseReturnType } from '../../../../../observability/typings/common'; import { SERVICE_NAME, TRANSACTION_NAME, - TRANSACTION_RESULT, TRANSACTION_TYPE, -} from '../../../../../common/elasticsearch_fieldnames'; -import { rangeFilter } from '../../../../../common/utils/range_filter'; +} from '../../../../common/elasticsearch_fieldnames'; +import { rangeFilter } from '../../../../common/utils/range_filter'; import { getDocumentTypeFilterForAggregatedTransactions, getProcessorEventForAggregatedTransactions, getTransactionDurationFieldForAggregatedTransactions, -} from '../../../helpers/aggregated_transactions'; -import { getBucketSize } from '../../../helpers/get_bucket_size'; -import { Setup, SetupTimeRange } from '../../../helpers/setup_request'; +} from '../../../lib/helpers/aggregated_transactions'; +import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; +import { Setup, SetupTimeRange } from '../../../lib/helpers/setup_request'; +import { convertLatencyBucketsToCoordinates } from './transform'; + +export type LatencyChartsResponse = PromiseReturnType; -export type ESResponse = PromiseReturnType; -export function timeseriesFetcher({ +async function searchLatency({ serviceName, transactionType, transactionName, @@ -51,11 +51,14 @@ export function timeseriesFetcher({ filter.push({ term: { [TRANSACTION_NAME]: transactionName } }); } - // TODO reimplement these as uiFilters if (transactionType) { filter.push({ term: { [TRANSACTION_TYPE]: transactionType } }); } + const field = getTransactionDurationFieldForAggregatedTransactions( + searchAggregatedTransactions + ); + const params = { apm: { events: [ @@ -76,56 +79,57 @@ export function timeseriesFetcher({ extended_bounds: { min: start, max: end }, }, aggs: { - avg: { - avg: { - field: getTransactionDurationFieldForAggregatedTransactions( - searchAggregatedTransactions - ), - }, - }, + avg: { avg: { field } }, pct: { percentiles: { - field: getTransactionDurationFieldForAggregatedTransactions( - searchAggregatedTransactions - ), + field, percents: [95, 99], hdr: { number_of_significant_value_digits: 2 }, }, }, }, }, - overall_avg_duration: { - avg: { - field: getTransactionDurationFieldForAggregatedTransactions( - searchAggregatedTransactions - ), - }, - }, - transaction_results: { - terms: { field: TRANSACTION_RESULT, missing: '' }, - aggs: { - timeseries: { - date_histogram: { - field: '@timestamp', - fixed_interval: intervalString, - min_doc_count: 0, - extended_bounds: { min: start, max: end }, - }, - aggs: { - count: { - value_count: { - field: getTransactionDurationFieldForAggregatedTransactions( - searchAggregatedTransactions - ), - }, - }, - }, - }, - }, - }, + overall_avg_duration: { avg: { field } }, }, }, }; return apmEventClient.search(params); } + +export async function getLatencyCharts({ + serviceName, + transactionType, + transactionName, + setup, + searchAggregatedTransactions, +}: { + serviceName: string; + transactionType: string | undefined; + transactionName: string | undefined; + setup: Setup & SetupTimeRange; + searchAggregatedTransactions: boolean; +}) { + const response = await searchLatency({ + serviceName, + transactionType, + transactionName, + setup, + searchAggregatedTransactions, + }); + + if (!response.aggregations) { + return { + latency: null, + overallAvgDuration: null, + }; + } + + return { + overallAvgDuration: + response.aggregations.overall_avg_duration.value || null, + latency: convertLatencyBucketsToCoordinates( + response.aggregations.response_times.buckets + ), + }; +} diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts new file mode 100644 index 0000000000000..81eb0b94a58e5 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts @@ -0,0 +1,31 @@ +/* + * 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 { isNumber } from 'lodash'; +import { LatencyChartsResponse } from '.'; +import { Coordinate } from '../../../../typings/timeseries'; + +type LatencyBuckets = Required['aggregations']['response_times']['buckets']; + +export function convertLatencyBucketsToCoordinates( + latencyBuckets: LatencyBuckets = [] +) { + return latencyBuckets.reduce( + (acc, bucket) => { + const { '95.0': p95, '99.0': p99 } = bucket.pct.values; + + acc.avg.push({ x: bucket.key, y: bucket.avg.value }); + acc.p95.push({ x: bucket.key, y: isNumber(p95) ? p95 : null }); + acc.p99.push({ x: bucket.key, y: isNumber(p99) ? p99 : null }); + return acc; + }, + { + avg: [] as Coordinate[], + p95: [] as Coordinate[], + p99: [] as Coordinate[], + } + ); +} diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts new file mode 100644 index 0000000000000..a3878d21db031 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts @@ -0,0 +1,137 @@ +/* + * 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 { ESFilter } from '../../../../../../typings/elasticsearch'; +import { PromiseReturnType } from '../../../../../observability/typings/common'; +import { + SERVICE_NAME, + TRANSACTION_NAME, + TRANSACTION_RESULT, + TRANSACTION_TYPE, +} from '../../../../common/elasticsearch_fieldnames'; +import { rangeFilter } from '../../../../common/utils/range_filter'; +import { + getDocumentTypeFilterForAggregatedTransactions, + getProcessorEventForAggregatedTransactions, + getTransactionDurationFieldForAggregatedTransactions, +} from '../../../lib/helpers/aggregated_transactions'; +import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; +import { Setup, SetupTimeRange } from '../../../lib/helpers/setup_request'; +import { getThroughputBuckets } from './transform'; + +export type ThroughputChartsResponse = PromiseReturnType< + typeof searchThroughput +>; + +async function searchThroughput({ + serviceName, + transactionType, + transactionName, + setup, + searchAggregatedTransactions, + intervalString, +}: { + serviceName: string; + transactionType: string | undefined; + transactionName: string | undefined; + setup: Setup & SetupTimeRange; + searchAggregatedTransactions: boolean; + intervalString: string; +}) { + const { start, end, apmEventClient } = setup; + + const filter: ESFilter[] = [ + { term: { [SERVICE_NAME]: serviceName } }, + { range: rangeFilter(start, end) }, + ...getDocumentTypeFilterForAggregatedTransactions( + searchAggregatedTransactions + ), + ...setup.esFilter, + ]; + + if (transactionName) { + filter.push({ term: { [TRANSACTION_NAME]: transactionName } }); + } + + if (transactionType) { + filter.push({ term: { [TRANSACTION_TYPE]: transactionType } }); + } + + const field = getTransactionDurationFieldForAggregatedTransactions( + searchAggregatedTransactions + ); + + const params = { + apm: { + events: [ + getProcessorEventForAggregatedTransactions( + searchAggregatedTransactions + ), + ], + }, + body: { + size: 0, + query: { bool: { filter } }, + aggs: { + transaction_results: { + terms: { field: TRANSACTION_RESULT, missing: '' }, + aggs: { + timeseries: { + date_histogram: { + field: '@timestamp', + fixed_interval: intervalString, + min_doc_count: 0, + extended_bounds: { min: start, max: end }, + }, + aggs: { count: { value_count: { field } } }, + }, + }, + }, + }, + }, + }; + + return apmEventClient.search(params); +} + +export async function getThroughputCharts({ + serviceName, + transactionType, + transactionName, + setup, + searchAggregatedTransactions, +}: { + serviceName: string; + transactionType: string | undefined; + transactionName: string | undefined; + setup: Setup & SetupTimeRange; + searchAggregatedTransactions: boolean; +}) { + const { start, end } = setup; + const { bucketSize, intervalString } = getBucketSize({ start, end }); + const durationAsMinutes = (end - start) / 1000 / 60; + + const response = await searchThroughput({ + serviceName, + transactionType, + transactionName, + setup, + searchAggregatedTransactions, + intervalString, + }); + + if (!response.aggregations) { + return { throughput: [] }; + } + + return { + throughput: getThroughputBuckets({ + transactionResultBuckets: + response.aggregations.transaction_results.buckets, + bucketSize, + durationAsMinutes, + }), + }; +} diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.ts b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.ts new file mode 100644 index 0000000000000..3a71253a447be --- /dev/null +++ b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.ts @@ -0,0 +1,51 @@ +/* + * 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 { sortBy } from 'lodash'; +import { NOT_AVAILABLE_LABEL } from '../../../../common/i18n'; +import { ThroughputChartsResponse } from '.'; + +type TransactionResultBuckets = Required['aggregations']['transaction_results']['buckets']; + +export function getThroughputBuckets({ + transactionResultBuckets = [], + bucketSize, + durationAsMinutes, +}: { + transactionResultBuckets: TransactionResultBuckets; + bucketSize: number; + durationAsMinutes: number; +}) { + const buckets = transactionResultBuckets.map( + ({ key: resultKey, timeseries }) => { + const dataPoints = timeseries.buckets.map((bucket) => { + return { + x: bucket.key, + // divide by minutes + y: bucket.count.value / (bucketSize / 60), + }; + }); + + // Handle empty string result keys + const key = + resultKey === '' ? NOT_AVAILABLE_LABEL : (resultKey as string); + + const docCountTotal = timeseries.buckets + .map((bucket) => bucket.count.value) + .reduce((a, b) => a + b, 0); + + // calculate request/minute + const avg = docCountTotal / durationAsMinutes; + + return { key, dataPoints, avg }; + } + ); + + return sortBy( + buckets, + (bucket) => bucket.key.toString().replace(/^HTTP (\d)xx$/, '00$1') // ensure that HTTP 3xx are sorted at the top + ); +} diff --git a/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts b/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts index 11d247ccab84f..8d0ae0f80be8a 100644 --- a/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts +++ b/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts @@ -11,12 +11,14 @@ import { getSearchAggregatedTransactions } from '../../lib/helpers/aggregated_tr import { setupRequest } from '../../lib/helpers/setup_request'; import { getServiceTransactionGroups } from '../../lib/services/get_service_transaction_groups'; import { getTransactionBreakdown } from '../../lib/transactions/breakdown'; -import { getTransactionCharts } from '../../lib/transactions/charts'; +import { getAnomalySeries } from '../../lib/transactions/charts/get_anomaly_data'; import { getTransactionDistribution } from '../../lib/transactions/distribution'; import { getTransactionGroupList } from '../../lib/transaction_groups'; import { getErrorRate } from '../../lib/transaction_groups/get_error_rate'; import { createRoute } from '../create_route'; import { rangeRt, uiFiltersRt } from '../default_api_types'; +import { getLatencyCharts } from './get_latency_charts'; +import { getThroughputCharts } from './get_throughput_charts'; /** * Returns a list of transactions grouped by name @@ -107,15 +109,61 @@ export const transactionGroupsOverviewRoute = createRoute({ }, }); -/** - * Returns timeseries for latency, throughput and anomalies - * TODO: break it into 3 new APIs: - * - Latency: /transactions/charts/latency - * - Throughput: /transactions/charts/throughput - * - anomalies: /transactions/charts/anomaly - */ -export const transactionChartsRoute = createRoute({ - endpoint: 'GET /api/apm/services/{serviceName}/transactions/charts', +// // /** +// // * Returns timeseries for latency, throughput and anomalies +// // * TODO: break it into 3 new APIs: +// // * - Latency: /transactions/charts/latency +// // * - Throughput: /transactions/charts/throughput +// // * - anomalies: /transactions/charts/anomaly +// // */ +// export const transactionChartsRoute = createRoute({ +// endpoint: 'GET /api/apm/services/{serviceName}/transactions/charts', +// params: t.type({ +// path: t.type({ +// serviceName: t.string, +// }), +// query: t.intersection([ +// t.partial({ +// transactionType: t.string, +// transactionName: t.string, +// }), +// uiFiltersRt, +// rangeRt, +// ]), +// }), +// options: { tags: ['access:apm'] }, +// handler: async ({ context, request }) => { +// const setup = await setupRequest(context, request); +// const logger = context.logger; +// const { serviceName } = context.params.path; +// const { transactionType, transactionName } = context.params.query; + +// if (!setup.uiFilters.environment) { +// throw Boom.badRequest( +// `environment is a required property of the ?uiFilters JSON for transaction_groups/charts.` +// ); +// } + +// const searchAggregatedTransactions = await getSearchAggregatedTransactions( +// setup +// ); + +// const options = { +// serviceName, +// transactionType, +// transactionName, +// setup, +// searchAggregatedTransactions, +// logger, +// }; + +// return getTransactionCharts(options); +// }, +// }); + + +export const transactionLatencyChatsRoute = createRoute({ + endpoint: 'GET /api/apm/services/{serviceName}/transactions/charts/latency', params: t.type({ path: t.type({ serviceName: t.string, @@ -152,10 +200,58 @@ export const transactionChartsRoute = createRoute({ transactionName, setup, searchAggregatedTransactions, - logger, }; - return getTransactionCharts(options); + const {latency, overallAvgDuration} = await getLatencyCharts(options); + + const anomalyTimeseries = latency ? await getAnomalySeries({ + ...options, + logger, + timeSeriesDates: latency.avg.map(({x}) => x), + }) : null + + return {latency, overallAvgDuration, anomalyTimeseries} + }, +}); + +export const transactionThroughputChatsRoute = createRoute({ + endpoint: 'GET /api/apm/services/{serviceName}/transactions/charts/throughput', + params: t.type({ + path: t.type({ + serviceName: t.string, + }), + query: t.intersection([ + t.partial({ + transactionType: t.string, + transactionName: t.string, + }), + uiFiltersRt, + rangeRt, + ]), + }), + options: { tags: ['access:apm'] }, + handler: async ({ context, request }) => { + const setup = await setupRequest(context, request); + const { serviceName } = context.params.path; + const { transactionType, transactionName } = context.params.query; + + if (!setup.uiFilters.environment) { + throw Boom.badRequest( + `environment is a required property of the ?uiFilters JSON for transaction_groups/charts.` + ); + } + + const searchAggregatedTransactions = await getSearchAggregatedTransactions( + setup + ); + + return await getThroughputCharts({ + serviceName, + transactionType, + transactionName, + setup, + searchAggregatedTransactions, + }); }, }); From f131356dde1e7670b92ec22250cdcd0676d7057e Mon Sep 17 00:00:00 2001 From: cauemarcondes Date: Mon, 7 Dec 2020 14:23:28 +0100 Subject: [PATCH 02/10] adding unit tests --- .../__snapshots__/get_buckets.test.ts.snap | 2 +- .../__snapshots__/queries.test.ts.snap | 318 - .../mock_responses/timeseries_response.ts | 6748 ----------------- .../get_timeseries_data/transform.test.ts | 159 - .../transactions/get_latency_charts/index.ts | 4 +- .../mock_response/timeseries_response.ts | 161 + .../get_latency_charts/transform.test.ts | 56 + .../get_latency_charts/transform.ts | 2 +- .../get_throughput_charts/index.ts | 5 +- .../mock_response/timeseries_response.ts | 239 + .../get_throughput_charts/transform.test.ts | 125 + .../get_throughput_charts/transform.ts | 8 +- 12 files changed, 591 insertions(+), 7236 deletions(-) delete mode 100644 x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/mock_responses/timeseries_response.ts delete mode 100644 x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.test.ts create mode 100644 x-pack/plugins/apm/server/routes/transactions/get_latency_charts/mock_response/timeseries_response.ts create mode 100644 x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.test.ts create mode 100644 x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/mock_response/timeseries_response.ts create mode 100644 x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.test.ts diff --git a/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/__snapshots__/get_buckets.test.ts.snap b/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/__snapshots__/get_buckets.test.ts.snap index 085bedf774c46..43fe4dfe752e6 100644 --- a/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/__snapshots__/get_buckets.test.ts.snap +++ b/x-pack/plugins/apm/server/lib/errors/distribution/__tests__/__snapshots__/get_buckets.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`timeseriesFetcher should make the correct query 1`] = ` +exports[`get buckets should make the correct query 1`] = ` Array [ Array [ Object { diff --git a/x-pack/plugins/apm/server/lib/transactions/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/transactions/__snapshots__/queries.test.ts.snap index 3e0a7317afd70..5d6a92a874111 100644 --- a/x-pack/plugins/apm/server/lib/transactions/__snapshots__/queries.test.ts.snap +++ b/x-pack/plugins/apm/server/lib/transactions/__snapshots__/queries.test.ts.snap @@ -311,324 +311,6 @@ Object { } `; -exports[`transaction queries fetches transaction charts 1`] = ` -Object { - "apm": Object { - "events": Array [ - "transaction", - ], - }, - "body": Object { - "aggs": Object { - "overall_avg_duration": Object { - "avg": Object { - "field": "transaction.duration.us", - }, - }, - "response_times": Object { - "aggs": Object { - "avg": Object { - "avg": Object { - "field": "transaction.duration.us", - }, - }, - "pct": Object { - "percentiles": Object { - "field": "transaction.duration.us", - "hdr": Object { - "number_of_significant_value_digits": 2, - }, - "percents": Array [ - 95, - 99, - ], - }, - }, - }, - "date_histogram": Object { - "extended_bounds": Object { - "max": 1528977600000, - "min": 1528113600000, - }, - "field": "@timestamp", - "fixed_interval": "10800s", - "min_doc_count": 0, - }, - }, - "transaction_results": Object { - "aggs": Object { - "timeseries": Object { - "aggs": Object { - "count": Object { - "value_count": Object { - "field": "transaction.duration.us", - }, - }, - }, - "date_histogram": Object { - "extended_bounds": Object { - "max": 1528977600000, - "min": 1528113600000, - }, - "field": "@timestamp", - "fixed_interval": "10800s", - "min_doc_count": 0, - }, - }, - }, - "terms": Object { - "field": "transaction.result", - "missing": "", - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "service.name": "foo", - }, - }, - Object { - "range": Object { - "@timestamp": Object { - "format": "epoch_millis", - "gte": 1528113600000, - "lte": 1528977600000, - }, - }, - }, - Object { - "term": Object { - "service.environment": "test", - }, - }, - ], - }, - }, - "size": 0, - }, -} -`; - -exports[`transaction queries fetches transaction charts for a transaction type 1`] = ` -Object { - "apm": Object { - "events": Array [ - "transaction", - ], - }, - "body": Object { - "aggs": Object { - "overall_avg_duration": Object { - "avg": Object { - "field": "transaction.duration.us", - }, - }, - "response_times": Object { - "aggs": Object { - "avg": Object { - "avg": Object { - "field": "transaction.duration.us", - }, - }, - "pct": Object { - "percentiles": Object { - "field": "transaction.duration.us", - "hdr": Object { - "number_of_significant_value_digits": 2, - }, - "percents": Array [ - 95, - 99, - ], - }, - }, - }, - "date_histogram": Object { - "extended_bounds": Object { - "max": 1528977600000, - "min": 1528113600000, - }, - "field": "@timestamp", - "fixed_interval": "10800s", - "min_doc_count": 0, - }, - }, - "transaction_results": Object { - "aggs": Object { - "timeseries": Object { - "aggs": Object { - "count": Object { - "value_count": Object { - "field": "transaction.duration.us", - }, - }, - }, - "date_histogram": Object { - "extended_bounds": Object { - "max": 1528977600000, - "min": 1528113600000, - }, - "field": "@timestamp", - "fixed_interval": "10800s", - "min_doc_count": 0, - }, - }, - }, - "terms": Object { - "field": "transaction.result", - "missing": "", - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "service.name": "foo", - }, - }, - Object { - "range": Object { - "@timestamp": Object { - "format": "epoch_millis", - "gte": 1528113600000, - "lte": 1528977600000, - }, - }, - }, - Object { - "term": Object { - "service.environment": "test", - }, - }, - Object { - "term": Object { - "transaction.name": "bar", - }, - }, - ], - }, - }, - "size": 0, - }, -} -`; - -exports[`transaction queries fetches transaction charts for a transaction type and transaction name 1`] = ` -Object { - "apm": Object { - "events": Array [ - "transaction", - ], - }, - "body": Object { - "aggs": Object { - "overall_avg_duration": Object { - "avg": Object { - "field": "transaction.duration.us", - }, - }, - "response_times": Object { - "aggs": Object { - "avg": Object { - "avg": Object { - "field": "transaction.duration.us", - }, - }, - "pct": Object { - "percentiles": Object { - "field": "transaction.duration.us", - "hdr": Object { - "number_of_significant_value_digits": 2, - }, - "percents": Array [ - 95, - 99, - ], - }, - }, - }, - "date_histogram": Object { - "extended_bounds": Object { - "max": 1528977600000, - "min": 1528113600000, - }, - "field": "@timestamp", - "fixed_interval": "10800s", - "min_doc_count": 0, - }, - }, - "transaction_results": Object { - "aggs": Object { - "timeseries": Object { - "aggs": Object { - "count": Object { - "value_count": Object { - "field": "transaction.duration.us", - }, - }, - }, - "date_histogram": Object { - "extended_bounds": Object { - "max": 1528977600000, - "min": 1528113600000, - }, - "field": "@timestamp", - "fixed_interval": "10800s", - "min_doc_count": 0, - }, - }, - }, - "terms": Object { - "field": "transaction.result", - "missing": "", - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "service.name": "foo", - }, - }, - Object { - "range": Object { - "@timestamp": Object { - "format": "epoch_millis", - "gte": 1528113600000, - "lte": 1528977600000, - }, - }, - }, - Object { - "term": Object { - "service.environment": "test", - }, - }, - Object { - "term": Object { - "transaction.name": "bar", - }, - }, - Object { - "term": Object { - "transaction.type": "baz", - }, - }, - ], - }, - }, - "size": 0, - }, -} -`; - exports[`transaction queries fetches transaction distribution 1`] = ` Object { "apm": Object { diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/mock_responses/timeseries_response.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/mock_responses/timeseries_response.ts deleted file mode 100644 index 67084f8a42536..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/mock_responses/timeseries_response.ts +++ /dev/null @@ -1,6748 +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 { ESResponse } from '../fetcher'; - -export const timeseriesResponse = ({ - took: 206, - timed_out: false, - _shards: { - total: 9, - successful: 9, - skipped: 0, - failed: 0, - }, - hits: { - total: { - value: 10000, - relation: 'gte', - }, - max_score: null, - hits: [], - }, - aggregations: { - transaction_results: { - doc_count_error_upper_bound: 0, - sum_other_doc_count: 0, - buckets: [ - { - key: 'A Custom Bucket (that should be last)', - doc_count: 0, - timeseries: { buckets: [] }, - }, - { - key: 'HTTP 2xx', - doc_count: 12150, - timeseries: { - buckets: [ - { - key_as_string: '2020-07-04T08:40:00.000Z', - key: 1593852000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T08:50:00.000Z', - key: 1593852600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:00:00.000Z', - key: 1593853200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:10:00.000Z', - key: 1593853800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:20:00.000Z', - key: 1593854400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:30:00.000Z', - key: 1593855000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:40:00.000Z', - key: 1593855600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:50:00.000Z', - key: 1593856200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:00:00.000Z', - key: 1593856800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:10:00.000Z', - key: 1593857400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:20:00.000Z', - key: 1593858000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:30:00.000Z', - key: 1593858600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:40:00.000Z', - key: 1593859200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:50:00.000Z', - key: 1593859800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:00:00.000Z', - key: 1593860400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:10:00.000Z', - key: 1593861000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:20:00.000Z', - key: 1593861600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:30:00.000Z', - key: 1593862200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:40:00.000Z', - key: 1593862800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:50:00.000Z', - key: 1593863400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:00:00.000Z', - key: 1593864000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:10:00.000Z', - key: 1593864600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:20:00.000Z', - key: 1593865200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:30:00.000Z', - key: 1593865800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:40:00.000Z', - key: 1593866400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:50:00.000Z', - key: 1593867000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:00:00.000Z', - key: 1593867600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:10:00.000Z', - key: 1593868200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:20:00.000Z', - key: 1593868800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:30:00.000Z', - key: 1593869400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:40:00.000Z', - key: 1593870000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:50:00.000Z', - key: 1593870600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:00:00.000Z', - key: 1593871200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:10:00.000Z', - key: 1593871800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:20:00.000Z', - key: 1593872400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:30:00.000Z', - key: 1593873000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:40:00.000Z', - key: 1593873600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:50:00.000Z', - key: 1593874200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:00:00.000Z', - key: 1593874800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:10:00.000Z', - key: 1593875400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:20:00.000Z', - key: 1593876000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:30:00.000Z', - key: 1593876600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:40:00.000Z', - key: 1593877200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:50:00.000Z', - key: 1593877800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:00:00.000Z', - key: 1593878400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:10:00.000Z', - key: 1593879000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:20:00.000Z', - key: 1593879600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:30:00.000Z', - key: 1593880200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:40:00.000Z', - key: 1593880800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:50:00.000Z', - key: 1593881400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:00:00.000Z', - key: 1593882000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:10:00.000Z', - key: 1593882600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:20:00.000Z', - key: 1593883200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:30:00.000Z', - key: 1593883800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:40:00.000Z', - key: 1593884400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:50:00.000Z', - key: 1593885000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:00:00.000Z', - key: 1593885600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:10:00.000Z', - key: 1593886200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:20:00.000Z', - key: 1593886800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:30:00.000Z', - key: 1593887400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:40:00.000Z', - key: 1593888000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:50:00.000Z', - key: 1593888600000, - doc_count: 169, - count: { - value: 169, - }, - }, - { - key_as_string: '2020-07-04T19:00:00.000Z', - key: 1593889200000, - doc_count: 444, - count: { - value: 444, - }, - }, - { - key_as_string: '2020-07-04T19:10:00.000Z', - key: 1593889800000, - doc_count: 460, - count: { - value: 460, - }, - }, - { - key_as_string: '2020-07-04T19:20:00.000Z', - key: 1593890400000, - doc_count: 506, - count: { - value: 506, - }, - }, - { - key_as_string: '2020-07-04T19:30:00.000Z', - key: 1593891000000, - doc_count: 479, - count: { - value: 479, - }, - }, - { - key_as_string: '2020-07-04T19:40:00.000Z', - key: 1593891600000, - doc_count: 457, - count: { - value: 457, - }, - }, - { - key_as_string: '2020-07-04T19:50:00.000Z', - key: 1593892200000, - doc_count: 514, - count: { - value: 514, - }, - }, - { - key_as_string: '2020-07-04T20:00:00.000Z', - key: 1593892800000, - doc_count: 482, - count: { - value: 482, - }, - }, - { - key_as_string: '2020-07-04T20:10:00.000Z', - key: 1593893400000, - doc_count: 504, - count: { - value: 504, - }, - }, - { - key_as_string: '2020-07-04T20:20:00.000Z', - key: 1593894000000, - doc_count: 532, - count: { - value: 532, - }, - }, - { - key_as_string: '2020-07-04T20:30:00.000Z', - key: 1593894600000, - doc_count: 458, - count: { - value: 458, - }, - }, - { - key_as_string: '2020-07-04T20:40:00.000Z', - key: 1593895200000, - doc_count: 448, - count: { - value: 448, - }, - }, - { - key_as_string: '2020-07-04T20:50:00.000Z', - key: 1593895800000, - doc_count: 468, - count: { - value: 468, - }, - }, - { - key_as_string: '2020-07-04T21:00:00.000Z', - key: 1593896400000, - doc_count: 526, - count: { - value: 526, - }, - }, - { - key_as_string: '2020-07-04T21:10:00.000Z', - key: 1593897000000, - doc_count: 495, - count: { - value: 495, - }, - }, - { - key_as_string: '2020-07-04T21:20:00.000Z', - key: 1593897600000, - doc_count: 492, - count: { - value: 492, - }, - }, - { - key_as_string: '2020-07-04T21:30:00.000Z', - key: 1593898200000, - doc_count: 487, - count: { - value: 487, - }, - }, - { - key_as_string: '2020-07-04T21:40:00.000Z', - key: 1593898800000, - doc_count: 491, - count: { - value: 491, - }, - }, - { - key_as_string: '2020-07-04T21:50:00.000Z', - key: 1593899400000, - doc_count: 486, - count: { - value: 486, - }, - }, - { - key_as_string: '2020-07-04T22:00:00.000Z', - key: 1593900000000, - doc_count: 458, - count: { - value: 458, - }, - }, - { - key_as_string: '2020-07-04T22:10:00.000Z', - key: 1593900600000, - doc_count: 528, - count: { - value: 528, - }, - }, - { - key_as_string: '2020-07-04T22:20:00.000Z', - key: 1593901200000, - doc_count: 467, - count: { - value: 467, - }, - }, - { - key_as_string: '2020-07-04T22:30:00.000Z', - key: 1593901800000, - doc_count: 179, - count: { - value: 179, - }, - }, - { - key_as_string: '2020-07-04T22:40:00.000Z', - key: 1593902400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T22:50:00.000Z', - key: 1593903000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:00:00.000Z', - key: 1593903600000, - doc_count: 39, - count: { - value: 39, - }, - }, - { - key_as_string: '2020-07-04T23:10:00.000Z', - key: 1593904200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:20:00.000Z', - key: 1593904800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:30:00.000Z', - key: 1593905400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:40:00.000Z', - key: 1593906000000, - doc_count: 36, - count: { - value: 36, - }, - }, - { - key_as_string: '2020-07-04T23:50:00.000Z', - key: 1593906600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:00:00.000Z', - key: 1593907200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:10:00.000Z', - key: 1593907800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:20:00.000Z', - key: 1593908400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:30:00.000Z', - key: 1593909000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:40:00.000Z', - key: 1593909600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:50:00.000Z', - key: 1593910200000, - doc_count: 34, - count: { - value: 34, - }, - }, - { - key_as_string: '2020-07-05T01:00:00.000Z', - key: 1593910800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:10:00.000Z', - key: 1593911400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:20:00.000Z', - key: 1593912000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:30:00.000Z', - key: 1593912600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:40:00.000Z', - key: 1593913200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:50:00.000Z', - key: 1593913800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:00:00.000Z', - key: 1593914400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:10:00.000Z', - key: 1593915000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:20:00.000Z', - key: 1593915600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:30:00.000Z', - key: 1593916200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:40:00.000Z', - key: 1593916800000, - doc_count: 31, - count: { - value: 31, - }, - }, - { - key_as_string: '2020-07-05T02:50:00.000Z', - key: 1593917400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:00:00.000Z', - key: 1593918000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:10:00.000Z', - key: 1593918600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:20:00.000Z', - key: 1593919200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:30:00.000Z', - key: 1593919800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:40:00.000Z', - key: 1593920400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:50:00.000Z', - key: 1593921000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:00:00.000Z', - key: 1593921600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:10:00.000Z', - key: 1593922200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:20:00.000Z', - key: 1593922800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:30:00.000Z', - key: 1593923400000, - doc_count: 49, - count: { - value: 49, - }, - }, - { - key_as_string: '2020-07-05T04:40:00.000Z', - key: 1593924000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:50:00.000Z', - key: 1593924600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:00:00.000Z', - key: 1593925200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:10:00.000Z', - key: 1593925800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:20:00.000Z', - key: 1593926400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:30:00.000Z', - key: 1593927000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:40:00.000Z', - key: 1593927600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:50:00.000Z', - key: 1593928200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:00:00.000Z', - key: 1593928800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:10:00.000Z', - key: 1593929400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:20:00.000Z', - key: 1593930000000, - doc_count: 50, - count: { - value: 50, - }, - }, - { - key_as_string: '2020-07-05T06:30:00.000Z', - key: 1593930600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:40:00.000Z', - key: 1593931200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:50:00.000Z', - key: 1593931800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:00:00.000Z', - key: 1593932400000, - doc_count: 37, - count: { - value: 37, - }, - }, - { - key_as_string: '2020-07-05T07:10:00.000Z', - key: 1593933000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:20:00.000Z', - key: 1593933600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:30:00.000Z', - key: 1593934200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:40:00.000Z', - key: 1593934800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:50:00.000Z', - key: 1593935400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T08:00:00.000Z', - key: 1593936000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T08:10:00.000Z', - key: 1593936600000, - doc_count: 194, - count: { - value: 194, - }, - }, - { - key_as_string: '2020-07-05T08:20:00.000Z', - key: 1593937200000, - doc_count: 385, - count: { - value: 385, - }, - }, - { - key_as_string: '2020-07-05T08:30:00.000Z', - key: 1593937800000, - doc_count: 421, - count: { - value: 421, - }, - }, - { - key_as_string: '2020-07-05T08:40:00.000Z', - key: 1593938400000, - doc_count: 344, - count: { - value: 344, - }, - }, - ], - }, - }, - { - key: 'HTTP 3xx', - doc_count: 3828, - timeseries: { - buckets: [ - { - key_as_string: '2020-07-04T08:40:00.000Z', - key: 1593852000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T08:50:00.000Z', - key: 1593852600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:00:00.000Z', - key: 1593853200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:10:00.000Z', - key: 1593853800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:20:00.000Z', - key: 1593854400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:30:00.000Z', - key: 1593855000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:40:00.000Z', - key: 1593855600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:50:00.000Z', - key: 1593856200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:00:00.000Z', - key: 1593856800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:10:00.000Z', - key: 1593857400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:20:00.000Z', - key: 1593858000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:30:00.000Z', - key: 1593858600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:40:00.000Z', - key: 1593859200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:50:00.000Z', - key: 1593859800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:00:00.000Z', - key: 1593860400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:10:00.000Z', - key: 1593861000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:20:00.000Z', - key: 1593861600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:30:00.000Z', - key: 1593862200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:40:00.000Z', - key: 1593862800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:50:00.000Z', - key: 1593863400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:00:00.000Z', - key: 1593864000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:10:00.000Z', - key: 1593864600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:20:00.000Z', - key: 1593865200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:30:00.000Z', - key: 1593865800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:40:00.000Z', - key: 1593866400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:50:00.000Z', - key: 1593867000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:00:00.000Z', - key: 1593867600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:10:00.000Z', - key: 1593868200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:20:00.000Z', - key: 1593868800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:30:00.000Z', - key: 1593869400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:40:00.000Z', - key: 1593870000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:50:00.000Z', - key: 1593870600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:00:00.000Z', - key: 1593871200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:10:00.000Z', - key: 1593871800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:20:00.000Z', - key: 1593872400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:30:00.000Z', - key: 1593873000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:40:00.000Z', - key: 1593873600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:50:00.000Z', - key: 1593874200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:00:00.000Z', - key: 1593874800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:10:00.000Z', - key: 1593875400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:20:00.000Z', - key: 1593876000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:30:00.000Z', - key: 1593876600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:40:00.000Z', - key: 1593877200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:50:00.000Z', - key: 1593877800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:00:00.000Z', - key: 1593878400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:10:00.000Z', - key: 1593879000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:20:00.000Z', - key: 1593879600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:30:00.000Z', - key: 1593880200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:40:00.000Z', - key: 1593880800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:50:00.000Z', - key: 1593881400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:00:00.000Z', - key: 1593882000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:10:00.000Z', - key: 1593882600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:20:00.000Z', - key: 1593883200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:30:00.000Z', - key: 1593883800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:40:00.000Z', - key: 1593884400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:50:00.000Z', - key: 1593885000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:00:00.000Z', - key: 1593885600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:10:00.000Z', - key: 1593886200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:20:00.000Z', - key: 1593886800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:30:00.000Z', - key: 1593887400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:40:00.000Z', - key: 1593888000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:50:00.000Z', - key: 1593888600000, - doc_count: 62, - count: { - value: 62, - }, - }, - { - key_as_string: '2020-07-04T19:00:00.000Z', - key: 1593889200000, - doc_count: 52, - count: { - value: 52, - }, - }, - { - key_as_string: '2020-07-04T19:10:00.000Z', - key: 1593889800000, - doc_count: 128, - count: { - value: 128, - }, - }, - { - key_as_string: '2020-07-04T19:20:00.000Z', - key: 1593890400000, - doc_count: 143, - count: { - value: 143, - }, - }, - { - key_as_string: '2020-07-04T19:30:00.000Z', - key: 1593891000000, - doc_count: 129, - count: { - value: 129, - }, - }, - { - key_as_string: '2020-07-04T19:40:00.000Z', - key: 1593891600000, - doc_count: 121, - count: { - value: 121, - }, - }, - { - key_as_string: '2020-07-04T19:50:00.000Z', - key: 1593892200000, - doc_count: 292, - count: { - value: 292, - }, - }, - { - key_as_string: '2020-07-04T20:00:00.000Z', - key: 1593892800000, - doc_count: 139, - count: { - value: 139, - }, - }, - { - key_as_string: '2020-07-04T20:10:00.000Z', - key: 1593893400000, - doc_count: 104, - count: { - value: 104, - }, - }, - { - key_as_string: '2020-07-04T20:20:00.000Z', - key: 1593894000000, - doc_count: 198, - count: { - value: 198, - }, - }, - { - key_as_string: '2020-07-04T20:30:00.000Z', - key: 1593894600000, - doc_count: 179, - count: { - value: 179, - }, - }, - { - key_as_string: '2020-07-04T20:40:00.000Z', - key: 1593895200000, - doc_count: 117, - count: { - value: 117, - }, - }, - { - key_as_string: '2020-07-04T20:50:00.000Z', - key: 1593895800000, - doc_count: 183, - count: { - value: 183, - }, - }, - { - key_as_string: '2020-07-04T21:00:00.000Z', - key: 1593896400000, - doc_count: 264, - count: { - value: 264, - }, - }, - { - key_as_string: '2020-07-04T21:10:00.000Z', - key: 1593897000000, - doc_count: 180, - count: { - value: 180, - }, - }, - { - key_as_string: '2020-07-04T21:20:00.000Z', - key: 1593897600000, - doc_count: 160, - count: { - value: 160, - }, - }, - { - key_as_string: '2020-07-04T21:30:00.000Z', - key: 1593898200000, - doc_count: 208, - count: { - value: 208, - }, - }, - { - key_as_string: '2020-07-04T21:40:00.000Z', - key: 1593898800000, - doc_count: 158, - count: { - value: 158, - }, - }, - { - key_as_string: '2020-07-04T21:50:00.000Z', - key: 1593899400000, - doc_count: 176, - count: { - value: 176, - }, - }, - { - key_as_string: '2020-07-04T22:00:00.000Z', - key: 1593900000000, - doc_count: 183, - count: { - value: 183, - }, - }, - { - key_as_string: '2020-07-04T22:10:00.000Z', - key: 1593900600000, - doc_count: 234, - count: { - value: 234, - }, - }, - { - key_as_string: '2020-07-04T22:20:00.000Z', - key: 1593901200000, - doc_count: 125, - count: { - value: 125, - }, - }, - { - key_as_string: '2020-07-04T22:30:00.000Z', - key: 1593901800000, - doc_count: 48, - count: { - value: 48, - }, - }, - { - key_as_string: '2020-07-04T22:40:00.000Z', - key: 1593902400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T22:50:00.000Z', - key: 1593903000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:00:00.000Z', - key: 1593903600000, - doc_count: 9, - count: { - value: 9, - }, - }, - { - key_as_string: '2020-07-04T23:10:00.000Z', - key: 1593904200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:20:00.000Z', - key: 1593904800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:30:00.000Z', - key: 1593905400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:40:00.000Z', - key: 1593906000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:50:00.000Z', - key: 1593906600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:00:00.000Z', - key: 1593907200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:10:00.000Z', - key: 1593907800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:20:00.000Z', - key: 1593908400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:30:00.000Z', - key: 1593909000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:40:00.000Z', - key: 1593909600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:50:00.000Z', - key: 1593910200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:00:00.000Z', - key: 1593910800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:10:00.000Z', - key: 1593911400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:20:00.000Z', - key: 1593912000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:30:00.000Z', - key: 1593912600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:40:00.000Z', - key: 1593913200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:50:00.000Z', - key: 1593913800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:00:00.000Z', - key: 1593914400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:10:00.000Z', - key: 1593915000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:20:00.000Z', - key: 1593915600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:30:00.000Z', - key: 1593916200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:40:00.000Z', - key: 1593916800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:50:00.000Z', - key: 1593917400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:00:00.000Z', - key: 1593918000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:10:00.000Z', - key: 1593918600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:20:00.000Z', - key: 1593919200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:30:00.000Z', - key: 1593919800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:40:00.000Z', - key: 1593920400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:50:00.000Z', - key: 1593921000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:00:00.000Z', - key: 1593921600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:10:00.000Z', - key: 1593922200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:20:00.000Z', - key: 1593922800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:30:00.000Z', - key: 1593923400000, - doc_count: 11, - count: { - value: 11, - }, - }, - { - key_as_string: '2020-07-05T04:40:00.000Z', - key: 1593924000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:50:00.000Z', - key: 1593924600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:00:00.000Z', - key: 1593925200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:10:00.000Z', - key: 1593925800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:20:00.000Z', - key: 1593926400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:30:00.000Z', - key: 1593927000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:40:00.000Z', - key: 1593927600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:50:00.000Z', - key: 1593928200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:00:00.000Z', - key: 1593928800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:10:00.000Z', - key: 1593929400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:20:00.000Z', - key: 1593930000000, - doc_count: 28, - count: { - value: 28, - }, - }, - { - key_as_string: '2020-07-05T06:30:00.000Z', - key: 1593930600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:40:00.000Z', - key: 1593931200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:50:00.000Z', - key: 1593931800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:00:00.000Z', - key: 1593932400000, - doc_count: 2, - count: { - value: 2, - }, - }, - { - key_as_string: '2020-07-05T07:10:00.000Z', - key: 1593933000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:20:00.000Z', - key: 1593933600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:30:00.000Z', - key: 1593934200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:40:00.000Z', - key: 1593934800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:50:00.000Z', - key: 1593935400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T08:00:00.000Z', - key: 1593936000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T08:10:00.000Z', - key: 1593936600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T08:20:00.000Z', - key: 1593937200000, - doc_count: 63, - count: { - value: 63, - }, - }, - { - key_as_string: '2020-07-05T08:30:00.000Z', - key: 1593937800000, - doc_count: 50, - count: { - value: 50, - }, - }, - { - key_as_string: '2020-07-05T08:40:00.000Z', - key: 1593938400000, - doc_count: 82, - count: { - value: 82, - }, - }, - ], - }, - }, - { - key: 'HTTP 4xx', - doc_count: 683, - timeseries: { - buckets: [ - { - key_as_string: '2020-07-04T08:40:00.000Z', - key: 1593852000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T08:50:00.000Z', - key: 1593852600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:00:00.000Z', - key: 1593853200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:10:00.000Z', - key: 1593853800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:20:00.000Z', - key: 1593854400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:30:00.000Z', - key: 1593855000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:40:00.000Z', - key: 1593855600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:50:00.000Z', - key: 1593856200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:00:00.000Z', - key: 1593856800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:10:00.000Z', - key: 1593857400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:20:00.000Z', - key: 1593858000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:30:00.000Z', - key: 1593858600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:40:00.000Z', - key: 1593859200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:50:00.000Z', - key: 1593859800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:00:00.000Z', - key: 1593860400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:10:00.000Z', - key: 1593861000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:20:00.000Z', - key: 1593861600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:30:00.000Z', - key: 1593862200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:40:00.000Z', - key: 1593862800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:50:00.000Z', - key: 1593863400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:00:00.000Z', - key: 1593864000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:10:00.000Z', - key: 1593864600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:20:00.000Z', - key: 1593865200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:30:00.000Z', - key: 1593865800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:40:00.000Z', - key: 1593866400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:50:00.000Z', - key: 1593867000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:00:00.000Z', - key: 1593867600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:10:00.000Z', - key: 1593868200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:20:00.000Z', - key: 1593868800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:30:00.000Z', - key: 1593869400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:40:00.000Z', - key: 1593870000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:50:00.000Z', - key: 1593870600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:00:00.000Z', - key: 1593871200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:10:00.000Z', - key: 1593871800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:20:00.000Z', - key: 1593872400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:30:00.000Z', - key: 1593873000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:40:00.000Z', - key: 1593873600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:50:00.000Z', - key: 1593874200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:00:00.000Z', - key: 1593874800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:10:00.000Z', - key: 1593875400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:20:00.000Z', - key: 1593876000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:30:00.000Z', - key: 1593876600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:40:00.000Z', - key: 1593877200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:50:00.000Z', - key: 1593877800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:00:00.000Z', - key: 1593878400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:10:00.000Z', - key: 1593879000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:20:00.000Z', - key: 1593879600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:30:00.000Z', - key: 1593880200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:40:00.000Z', - key: 1593880800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:50:00.000Z', - key: 1593881400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:00:00.000Z', - key: 1593882000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:10:00.000Z', - key: 1593882600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:20:00.000Z', - key: 1593883200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:30:00.000Z', - key: 1593883800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:40:00.000Z', - key: 1593884400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:50:00.000Z', - key: 1593885000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:00:00.000Z', - key: 1593885600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:10:00.000Z', - key: 1593886200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:20:00.000Z', - key: 1593886800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:30:00.000Z', - key: 1593887400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:40:00.000Z', - key: 1593888000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:50:00.000Z', - key: 1593888600000, - doc_count: 11, - count: { - value: 11, - }, - }, - { - key_as_string: '2020-07-04T19:00:00.000Z', - key: 1593889200000, - doc_count: 31, - count: { - value: 31, - }, - }, - { - key_as_string: '2020-07-04T19:10:00.000Z', - key: 1593889800000, - doc_count: 19, - count: { - value: 19, - }, - }, - { - key_as_string: '2020-07-04T19:20:00.000Z', - key: 1593890400000, - doc_count: 23, - count: { - value: 23, - }, - }, - { - key_as_string: '2020-07-04T19:30:00.000Z', - key: 1593891000000, - doc_count: 26, - count: { - value: 26, - }, - }, - { - key_as_string: '2020-07-04T19:40:00.000Z', - key: 1593891600000, - doc_count: 27, - count: { - value: 27, - }, - }, - { - key_as_string: '2020-07-04T19:50:00.000Z', - key: 1593892200000, - doc_count: 27, - count: { - value: 27, - }, - }, - { - key_as_string: '2020-07-04T20:00:00.000Z', - key: 1593892800000, - doc_count: 30, - count: { - value: 30, - }, - }, - { - key_as_string: '2020-07-04T20:10:00.000Z', - key: 1593893400000, - doc_count: 28, - count: { - value: 28, - }, - }, - { - key_as_string: '2020-07-04T20:20:00.000Z', - key: 1593894000000, - doc_count: 33, - count: { - value: 33, - }, - }, - { - key_as_string: '2020-07-04T20:30:00.000Z', - key: 1593894600000, - doc_count: 23, - count: { - value: 23, - }, - }, - { - key_as_string: '2020-07-04T20:40:00.000Z', - key: 1593895200000, - doc_count: 35, - count: { - value: 35, - }, - }, - { - key_as_string: '2020-07-04T20:50:00.000Z', - key: 1593895800000, - doc_count: 26, - count: { - value: 26, - }, - }, - { - key_as_string: '2020-07-04T21:00:00.000Z', - key: 1593896400000, - doc_count: 35, - count: { - value: 35, - }, - }, - { - key_as_string: '2020-07-04T21:10:00.000Z', - key: 1593897000000, - doc_count: 25, - count: { - value: 25, - }, - }, - { - key_as_string: '2020-07-04T21:20:00.000Z', - key: 1593897600000, - doc_count: 26, - count: { - value: 26, - }, - }, - { - key_as_string: '2020-07-04T21:30:00.000Z', - key: 1593898200000, - doc_count: 25, - count: { - value: 25, - }, - }, - { - key_as_string: '2020-07-04T21:40:00.000Z', - key: 1593898800000, - doc_count: 17, - count: { - value: 17, - }, - }, - { - key_as_string: '2020-07-04T21:50:00.000Z', - key: 1593899400000, - doc_count: 19, - count: { - value: 19, - }, - }, - { - key_as_string: '2020-07-04T22:00:00.000Z', - key: 1593900000000, - doc_count: 28, - count: { - value: 28, - }, - }, - { - key_as_string: '2020-07-04T22:10:00.000Z', - key: 1593900600000, - doc_count: 24, - count: { - value: 24, - }, - }, - { - key_as_string: '2020-07-04T22:20:00.000Z', - key: 1593901200000, - doc_count: 30, - count: { - value: 30, - }, - }, - { - key_as_string: '2020-07-04T22:30:00.000Z', - key: 1593901800000, - doc_count: 6, - count: { - value: 6, - }, - }, - { - key_as_string: '2020-07-04T22:40:00.000Z', - key: 1593902400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T22:50:00.000Z', - key: 1593903000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:00:00.000Z', - key: 1593903600000, - doc_count: 2, - count: { - value: 2, - }, - }, - { - key_as_string: '2020-07-04T23:10:00.000Z', - key: 1593904200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:20:00.000Z', - key: 1593904800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:30:00.000Z', - key: 1593905400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:40:00.000Z', - key: 1593906000000, - doc_count: 4, - count: { - value: 4, - }, - }, - { - key_as_string: '2020-07-04T23:50:00.000Z', - key: 1593906600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:00:00.000Z', - key: 1593907200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:10:00.000Z', - key: 1593907800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:20:00.000Z', - key: 1593908400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:30:00.000Z', - key: 1593909000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:40:00.000Z', - key: 1593909600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:50:00.000Z', - key: 1593910200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:00:00.000Z', - key: 1593910800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:10:00.000Z', - key: 1593911400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:20:00.000Z', - key: 1593912000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:30:00.000Z', - key: 1593912600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:40:00.000Z', - key: 1593913200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:50:00.000Z', - key: 1593913800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:00:00.000Z', - key: 1593914400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:10:00.000Z', - key: 1593915000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:20:00.000Z', - key: 1593915600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:30:00.000Z', - key: 1593916200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:40:00.000Z', - key: 1593916800000, - doc_count: 3, - count: { - value: 3, - }, - }, - { - key_as_string: '2020-07-05T02:50:00.000Z', - key: 1593917400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:00:00.000Z', - key: 1593918000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:10:00.000Z', - key: 1593918600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:20:00.000Z', - key: 1593919200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:30:00.000Z', - key: 1593919800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:40:00.000Z', - key: 1593920400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:50:00.000Z', - key: 1593921000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:00:00.000Z', - key: 1593921600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:10:00.000Z', - key: 1593922200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:20:00.000Z', - key: 1593922800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:30:00.000Z', - key: 1593923400000, - doc_count: 2, - count: { - value: 2, - }, - }, - { - key_as_string: '2020-07-05T04:40:00.000Z', - key: 1593924000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:50:00.000Z', - key: 1593924600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:00:00.000Z', - key: 1593925200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:10:00.000Z', - key: 1593925800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:20:00.000Z', - key: 1593926400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:30:00.000Z', - key: 1593927000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:40:00.000Z', - key: 1593927600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:50:00.000Z', - key: 1593928200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:00:00.000Z', - key: 1593928800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:10:00.000Z', - key: 1593929400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:20:00.000Z', - key: 1593930000000, - doc_count: 3, - count: { - value: 3, - }, - }, - { - key_as_string: '2020-07-05T06:30:00.000Z', - key: 1593930600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:40:00.000Z', - key: 1593931200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:50:00.000Z', - key: 1593931800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:00:00.000Z', - key: 1593932400000, - doc_count: 2, - count: { - value: 2, - }, - }, - { - key_as_string: '2020-07-05T07:10:00.000Z', - key: 1593933000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:20:00.000Z', - key: 1593933600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:30:00.000Z', - key: 1593934200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:40:00.000Z', - key: 1593934800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:50:00.000Z', - key: 1593935400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T08:00:00.000Z', - key: 1593936000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T08:10:00.000Z', - key: 1593936600000, - doc_count: 15, - count: { - value: 15, - }, - }, - { - key_as_string: '2020-07-05T08:20:00.000Z', - key: 1593937200000, - doc_count: 29, - count: { - value: 29, - }, - }, - { - key_as_string: '2020-07-05T08:30:00.000Z', - key: 1593937800000, - doc_count: 31, - count: { - value: 31, - }, - }, - { - key_as_string: '2020-07-05T08:40:00.000Z', - key: 1593938400000, - doc_count: 18, - count: { - value: 18, - }, - }, - ], - }, - }, - { - key: 'HTTP 5xx', - doc_count: 378, - timeseries: { - buckets: [ - { - key_as_string: '2020-07-04T08:40:00.000Z', - key: 1593852000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T08:50:00.000Z', - key: 1593852600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:00:00.000Z', - key: 1593853200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:10:00.000Z', - key: 1593853800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:20:00.000Z', - key: 1593854400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:30:00.000Z', - key: 1593855000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:40:00.000Z', - key: 1593855600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T09:50:00.000Z', - key: 1593856200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:00:00.000Z', - key: 1593856800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:10:00.000Z', - key: 1593857400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:20:00.000Z', - key: 1593858000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:30:00.000Z', - key: 1593858600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:40:00.000Z', - key: 1593859200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T10:50:00.000Z', - key: 1593859800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:00:00.000Z', - key: 1593860400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:10:00.000Z', - key: 1593861000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:20:00.000Z', - key: 1593861600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:30:00.000Z', - key: 1593862200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:40:00.000Z', - key: 1593862800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T11:50:00.000Z', - key: 1593863400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:00:00.000Z', - key: 1593864000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:10:00.000Z', - key: 1593864600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:20:00.000Z', - key: 1593865200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:30:00.000Z', - key: 1593865800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:40:00.000Z', - key: 1593866400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T12:50:00.000Z', - key: 1593867000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:00:00.000Z', - key: 1593867600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:10:00.000Z', - key: 1593868200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:20:00.000Z', - key: 1593868800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:30:00.000Z', - key: 1593869400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:40:00.000Z', - key: 1593870000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T13:50:00.000Z', - key: 1593870600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:00:00.000Z', - key: 1593871200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:10:00.000Z', - key: 1593871800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:20:00.000Z', - key: 1593872400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:30:00.000Z', - key: 1593873000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:40:00.000Z', - key: 1593873600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T14:50:00.000Z', - key: 1593874200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:00:00.000Z', - key: 1593874800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:10:00.000Z', - key: 1593875400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:20:00.000Z', - key: 1593876000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:30:00.000Z', - key: 1593876600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:40:00.000Z', - key: 1593877200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T15:50:00.000Z', - key: 1593877800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:00:00.000Z', - key: 1593878400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:10:00.000Z', - key: 1593879000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:20:00.000Z', - key: 1593879600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:30:00.000Z', - key: 1593880200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:40:00.000Z', - key: 1593880800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T16:50:00.000Z', - key: 1593881400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:00:00.000Z', - key: 1593882000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:10:00.000Z', - key: 1593882600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:20:00.000Z', - key: 1593883200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:30:00.000Z', - key: 1593883800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:40:00.000Z', - key: 1593884400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T17:50:00.000Z', - key: 1593885000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:00:00.000Z', - key: 1593885600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:10:00.000Z', - key: 1593886200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:20:00.000Z', - key: 1593886800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:30:00.000Z', - key: 1593887400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:40:00.000Z', - key: 1593888000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T18:50:00.000Z', - key: 1593888600000, - doc_count: 5, - count: { - value: 5, - }, - }, - { - key_as_string: '2020-07-04T19:00:00.000Z', - key: 1593889200000, - doc_count: 15, - count: { - value: 15, - }, - }, - { - key_as_string: '2020-07-04T19:10:00.000Z', - key: 1593889800000, - doc_count: 12, - count: { - value: 12, - }, - }, - { - key_as_string: '2020-07-04T19:20:00.000Z', - key: 1593890400000, - doc_count: 16, - count: { - value: 16, - }, - }, - { - key_as_string: '2020-07-04T19:30:00.000Z', - key: 1593891000000, - doc_count: 12, - count: { - value: 12, - }, - }, - { - key_as_string: '2020-07-04T19:40:00.000Z', - key: 1593891600000, - doc_count: 16, - count: { - value: 16, - }, - }, - { - key_as_string: '2020-07-04T19:50:00.000Z', - key: 1593892200000, - doc_count: 23, - count: { - value: 23, - }, - }, - { - key_as_string: '2020-07-04T20:00:00.000Z', - key: 1593892800000, - doc_count: 10, - count: { - value: 10, - }, - }, - { - key_as_string: '2020-07-04T20:10:00.000Z', - key: 1593893400000, - doc_count: 10, - count: { - value: 10, - }, - }, - { - key_as_string: '2020-07-04T20:20:00.000Z', - key: 1593894000000, - doc_count: 18, - count: { - value: 18, - }, - }, - { - key_as_string: '2020-07-04T20:30:00.000Z', - key: 1593894600000, - doc_count: 10, - count: { - value: 10, - }, - }, - { - key_as_string: '2020-07-04T20:40:00.000Z', - key: 1593895200000, - doc_count: 17, - count: { - value: 17, - }, - }, - { - key_as_string: '2020-07-04T20:50:00.000Z', - key: 1593895800000, - doc_count: 13, - count: { - value: 13, - }, - }, - { - key_as_string: '2020-07-04T21:00:00.000Z', - key: 1593896400000, - doc_count: 18, - count: { - value: 18, - }, - }, - { - key_as_string: '2020-07-04T21:10:00.000Z', - key: 1593897000000, - doc_count: 17, - count: { - value: 17, - }, - }, - { - key_as_string: '2020-07-04T21:20:00.000Z', - key: 1593897600000, - doc_count: 17, - count: { - value: 17, - }, - }, - { - key_as_string: '2020-07-04T21:30:00.000Z', - key: 1593898200000, - doc_count: 11, - count: { - value: 11, - }, - }, - { - key_as_string: '2020-07-04T21:40:00.000Z', - key: 1593898800000, - doc_count: 10, - count: { - value: 10, - }, - }, - { - key_as_string: '2020-07-04T21:50:00.000Z', - key: 1593899400000, - doc_count: 18, - count: { - value: 18, - }, - }, - { - key_as_string: '2020-07-04T22:00:00.000Z', - key: 1593900000000, - doc_count: 16, - count: { - value: 16, - }, - }, - { - key_as_string: '2020-07-04T22:10:00.000Z', - key: 1593900600000, - doc_count: 12, - count: { - value: 12, - }, - }, - { - key_as_string: '2020-07-04T22:20:00.000Z', - key: 1593901200000, - doc_count: 18, - count: { - value: 18, - }, - }, - { - key_as_string: '2020-07-04T22:30:00.000Z', - key: 1593901800000, - doc_count: 8, - count: { - value: 8, - }, - }, - { - key_as_string: '2020-07-04T22:40:00.000Z', - key: 1593902400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T22:50:00.000Z', - key: 1593903000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:00:00.000Z', - key: 1593903600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:10:00.000Z', - key: 1593904200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:20:00.000Z', - key: 1593904800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:30:00.000Z', - key: 1593905400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-04T23:40:00.000Z', - key: 1593906000000, - doc_count: 1, - count: { - value: 1, - }, - }, - { - key_as_string: '2020-07-04T23:50:00.000Z', - key: 1593906600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:00:00.000Z', - key: 1593907200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:10:00.000Z', - key: 1593907800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:20:00.000Z', - key: 1593908400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:30:00.000Z', - key: 1593909000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:40:00.000Z', - key: 1593909600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T00:50:00.000Z', - key: 1593910200000, - doc_count: 3, - count: { - value: 3, - }, - }, - { - key_as_string: '2020-07-05T01:00:00.000Z', - key: 1593910800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:10:00.000Z', - key: 1593911400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:20:00.000Z', - key: 1593912000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:30:00.000Z', - key: 1593912600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:40:00.000Z', - key: 1593913200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T01:50:00.000Z', - key: 1593913800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:00:00.000Z', - key: 1593914400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:10:00.000Z', - key: 1593915000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:20:00.000Z', - key: 1593915600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:30:00.000Z', - key: 1593916200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T02:40:00.000Z', - key: 1593916800000, - doc_count: 3, - count: { - value: 3, - }, - }, - { - key_as_string: '2020-07-05T02:50:00.000Z', - key: 1593917400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:00:00.000Z', - key: 1593918000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:10:00.000Z', - key: 1593918600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:20:00.000Z', - key: 1593919200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:30:00.000Z', - key: 1593919800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:40:00.000Z', - key: 1593920400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T03:50:00.000Z', - key: 1593921000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:00:00.000Z', - key: 1593921600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:10:00.000Z', - key: 1593922200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:20:00.000Z', - key: 1593922800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:30:00.000Z', - key: 1593923400000, - doc_count: 2, - count: { - value: 2, - }, - }, - { - key_as_string: '2020-07-05T04:40:00.000Z', - key: 1593924000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T04:50:00.000Z', - key: 1593924600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:00:00.000Z', - key: 1593925200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:10:00.000Z', - key: 1593925800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:20:00.000Z', - key: 1593926400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:30:00.000Z', - key: 1593927000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:40:00.000Z', - key: 1593927600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T05:50:00.000Z', - key: 1593928200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:00:00.000Z', - key: 1593928800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:10:00.000Z', - key: 1593929400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:20:00.000Z', - key: 1593930000000, - doc_count: 2, - count: { - value: 2, - }, - }, - { - key_as_string: '2020-07-05T06:30:00.000Z', - key: 1593930600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:40:00.000Z', - key: 1593931200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T06:50:00.000Z', - key: 1593931800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:00:00.000Z', - key: 1593932400000, - doc_count: 1, - count: { - value: 1, - }, - }, - { - key_as_string: '2020-07-05T07:10:00.000Z', - key: 1593933000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:20:00.000Z', - key: 1593933600000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:30:00.000Z', - key: 1593934200000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:40:00.000Z', - key: 1593934800000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T07:50:00.000Z', - key: 1593935400000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T08:00:00.000Z', - key: 1593936000000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-07-05T08:10:00.000Z', - key: 1593936600000, - doc_count: 6, - count: { - value: 6, - }, - }, - { - key_as_string: '2020-07-05T08:20:00.000Z', - key: 1593937200000, - doc_count: 17, - count: { - value: 17, - }, - }, - { - key_as_string: '2020-07-05T08:30:00.000Z', - key: 1593937800000, - doc_count: 16, - count: { - value: 16, - }, - }, - { - key_as_string: '2020-07-05T08:40:00.000Z', - key: 1593938400000, - doc_count: 5, - count: { - value: 5, - }, - }, - ], - }, - }, - ], - }, - response_times: { - buckets: [ - { - key_as_string: '2020-07-04T08:40:00.000Z', - key: 1593852000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T08:50:00.000Z', - key: 1593852600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T09:00:00.000Z', - key: 1593853200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T09:10:00.000Z', - key: 1593853800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T09:20:00.000Z', - key: 1593854400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T09:30:00.000Z', - key: 1593855000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T09:40:00.000Z', - key: 1593855600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T09:50:00.000Z', - key: 1593856200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T10:00:00.000Z', - key: 1593856800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T10:10:00.000Z', - key: 1593857400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T10:20:00.000Z', - key: 1593858000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T10:30:00.000Z', - key: 1593858600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T10:40:00.000Z', - key: 1593859200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T10:50:00.000Z', - key: 1593859800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T11:00:00.000Z', - key: 1593860400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T11:10:00.000Z', - key: 1593861000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T11:20:00.000Z', - key: 1593861600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T11:30:00.000Z', - key: 1593862200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T11:40:00.000Z', - key: 1593862800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T11:50:00.000Z', - key: 1593863400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T12:00:00.000Z', - key: 1593864000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T12:10:00.000Z', - key: 1593864600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T12:20:00.000Z', - key: 1593865200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T12:30:00.000Z', - key: 1593865800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T12:40:00.000Z', - key: 1593866400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T12:50:00.000Z', - key: 1593867000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T13:00:00.000Z', - key: 1593867600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T13:10:00.000Z', - key: 1593868200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T13:20:00.000Z', - key: 1593868800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T13:30:00.000Z', - key: 1593869400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T13:40:00.000Z', - key: 1593870000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T13:50:00.000Z', - key: 1593870600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T14:00:00.000Z', - key: 1593871200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T14:10:00.000Z', - key: 1593871800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T14:20:00.000Z', - key: 1593872400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T14:30:00.000Z', - key: 1593873000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T14:40:00.000Z', - key: 1593873600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T14:50:00.000Z', - key: 1593874200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T15:00:00.000Z', - key: 1593874800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T15:10:00.000Z', - key: 1593875400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T15:20:00.000Z', - key: 1593876000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T15:30:00.000Z', - key: 1593876600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T15:40:00.000Z', - key: 1593877200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T15:50:00.000Z', - key: 1593877800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T16:00:00.000Z', - key: 1593878400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T16:10:00.000Z', - key: 1593879000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T16:20:00.000Z', - key: 1593879600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T16:30:00.000Z', - key: 1593880200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T16:40:00.000Z', - key: 1593880800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T16:50:00.000Z', - key: 1593881400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T17:00:00.000Z', - key: 1593882000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T17:10:00.000Z', - key: 1593882600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T17:20:00.000Z', - key: 1593883200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T17:30:00.000Z', - key: 1593883800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T17:40:00.000Z', - key: 1593884400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T17:50:00.000Z', - key: 1593885000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T18:00:00.000Z', - key: 1593885600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T18:10:00.000Z', - key: 1593886200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T18:20:00.000Z', - key: 1593886800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T18:30:00.000Z', - key: 1593887400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T18:40:00.000Z', - key: 1593888000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T18:50:00.000Z', - key: 1593888600000, - doc_count: 247, - pct: { - values: { - '95.0': 114680.0, - '99.0': 827384.0, - }, - }, - avg: { - value: 43364.46153846154, - }, - }, - { - key_as_string: '2020-07-04T19:00:00.000Z', - key: 1593889200000, - doc_count: 542, - pct: { - values: { - '95.0': 659448.0, - '99.0': 2326520.0, - }, - }, - avg: { - value: 147903.58671586716, - }, - }, - { - key_as_string: '2020-07-04T19:10:00.000Z', - key: 1593889800000, - doc_count: 619, - pct: { - values: { - '95.0': 122360.0, - '99.0': 1130488.0, - }, - }, - avg: { - value: 57370.52342487884, - }, - }, - { - key_as_string: '2020-07-04T19:20:00.000Z', - key: 1593890400000, - doc_count: 688, - pct: { - values: { - '95.0': 121336.0, - '99.0': 1032184.0, - }, - }, - avg: { - value: 59687.82558139535, - }, - }, - { - key_as_string: '2020-07-04T19:30:00.000Z', - key: 1593891000000, - doc_count: 646, - pct: { - values: { - '95.0': 120828.0, - '99.0': 770044.0, - }, - }, - avg: { - value: 51810.68111455108, - }, - }, - { - key_as_string: '2020-07-04T19:40:00.000Z', - key: 1593891600000, - doc_count: 621, - pct: { - values: { - '95.0': 139256.0, - '99.0': 651256.0, - }, - }, - avg: { - value: 51736.59420289855, - }, - }, - { - key_as_string: '2020-07-04T19:50:00.000Z', - key: 1593892200000, - doc_count: 856, - pct: { - values: { - '95.0': 76792.0, - '99.0': 667640.0, - }, - }, - avg: { - value: 37241.293224299065, - }, - }, - { - key_as_string: '2020-07-04T20:00:00.000Z', - key: 1593892800000, - doc_count: 661, - pct: { - values: { - '95.0': 129528.0, - '99.0': 708600.0, - }, - }, - avg: { - value: 49444.90771558245, - }, - }, - { - key_as_string: '2020-07-04T20:10:00.000Z', - key: 1593893400000, - doc_count: 646, - pct: { - values: { - '95.0': 378872.0, - '99.0': 815096.0, - }, - }, - avg: { - value: 56807.80495356037, - }, - }, - { - key_as_string: '2020-07-04T20:20:00.000Z', - key: 1593894000000, - doc_count: 781, - pct: { - values: { - '95.0': 97272.0, - '99.0': 688120.0, - }, - }, - avg: { - value: 43238.74519846351, - }, - }, - { - key_as_string: '2020-07-04T20:30:00.000Z', - key: 1593894600000, - doc_count: 670, - pct: { - values: { - '95.0': 102904.0, - '99.0': 978936.0, - }, - }, - avg: { - value: 51754.80149253731, - }, - }, - { - key_as_string: '2020-07-04T20:40:00.000Z', - key: 1593895200000, - doc_count: 617, - pct: { - values: { - '95.0': 100856.0, - '99.0': 839672.0, - }, - }, - avg: { - value: 47166.5964343598, - }, - }, - { - key_as_string: '2020-07-04T20:50:00.000Z', - key: 1593895800000, - doc_count: 690, - pct: { - values: { - '95.0': 97784.0, - '99.0': 757752.0, - }, - }, - avg: { - value: 41854.688405797104, - }, - }, - { - key_as_string: '2020-07-04T21:00:00.000Z', - key: 1593896400000, - doc_count: 843, - pct: { - values: { - '95.0': 72700.0, - '99.0': 577532.0, - }, - }, - avg: { - value: 30464.317912218266, - }, - }, - { - key_as_string: '2020-07-04T21:10:00.000Z', - key: 1593897000000, - doc_count: 717, - pct: { - values: { - '95.0': 98296.0, - '99.0': 618488.0, - }, - }, - avg: { - value: 41558.531380753135, - }, - }, - { - key_as_string: '2020-07-04T21:20:00.000Z', - key: 1593897600000, - doc_count: 695, - pct: { - values: { - '95.0': 112120.0, - '99.0': 565240.0, - }, - }, - avg: { - value: 41159.68345323741, - }, - }, - { - key_as_string: '2020-07-04T21:30:00.000Z', - key: 1593898200000, - doc_count: 731, - pct: { - values: { - '95.0': 91640.0, - '99.0': 618488.0, - }, - }, - avg: { - value: 34211.03967168263, - }, - }, - { - key_as_string: '2020-07-04T21:40:00.000Z', - key: 1593898800000, - doc_count: 676, - pct: { - values: { - '95.0': 83448.0, - '99.0': 655352.0, - }, - }, - avg: { - value: 41322.30621301775, - }, - }, - { - key_as_string: '2020-07-04T21:50:00.000Z', - key: 1593899400000, - doc_count: 699, - pct: { - values: { - '95.0': 84476.0, - '99.0': 843772.0, - }, - }, - avg: { - value: 42301.523605150214, - }, - }, - { - key_as_string: '2020-07-04T22:00:00.000Z', - key: 1593900000000, - doc_count: 685, - pct: { - values: { - '95.0': 117756.0, - '99.0': 831484.0, - }, - }, - avg: { - value: 59615.69343065693, - }, - }, - { - key_as_string: '2020-07-04T22:10:00.000Z', - key: 1593900600000, - doc_count: 798, - pct: { - values: { - '95.0': 66556.0, - '99.0': 430076.0, - }, - }, - avg: { - value: 29567.520050125313, - }, - }, - { - key_as_string: '2020-07-04T22:20:00.000Z', - key: 1593901200000, - doc_count: 640, - pct: { - values: { - '95.0': 130552.0, - '99.0': 864248.0, - }, - }, - avg: { - value: 56104.7484375, - }, - }, - { - key_as_string: '2020-07-04T22:30:00.000Z', - key: 1593901800000, - doc_count: 241, - pct: { - values: { - '95.0': 111608.0, - '99.0': 655352.0, - }, - }, - avg: { - value: 40900.70954356847, - }, - }, - { - key_as_string: '2020-07-04T22:40:00.000Z', - key: 1593902400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T22:50:00.000Z', - key: 1593903000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T23:00:00.000Z', - key: 1593903600000, - doc_count: 50, - pct: { - values: { - '95.0': 276448.0, - '99.0': 2883552.0, - }, - }, - avg: { - value: 141618.04, - }, - }, - { - key_as_string: '2020-07-04T23:10:00.000Z', - key: 1593904200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T23:20:00.000Z', - key: 1593904800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T23:30:00.000Z', - key: 1593905400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-04T23:40:00.000Z', - key: 1593906000000, - doc_count: 41, - pct: { - values: { - '95.0': 1028088.0, - '99.0': 6094840.0, - }, - }, - avg: { - value: 380742.48780487804, - }, - }, - { - key_as_string: '2020-07-04T23:50:00.000Z', - key: 1593906600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T00:00:00.000Z', - key: 1593907200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T00:10:00.000Z', - key: 1593907800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T00:20:00.000Z', - key: 1593908400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T00:30:00.000Z', - key: 1593909000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T00:40:00.000Z', - key: 1593909600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T00:50:00.000Z', - key: 1593910200000, - doc_count: 37, - pct: { - values: { - '95.0': 352128.0, - '99.0': 446336.0, - }, - }, - avg: { - value: 122524.7027027027, - }, - }, - { - key_as_string: '2020-07-05T01:00:00.000Z', - key: 1593910800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T01:10:00.000Z', - key: 1593911400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T01:20:00.000Z', - key: 1593912000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T01:30:00.000Z', - key: 1593912600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T01:40:00.000Z', - key: 1593913200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T01:50:00.000Z', - key: 1593913800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T02:00:00.000Z', - key: 1593914400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T02:10:00.000Z', - key: 1593915000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T02:20:00.000Z', - key: 1593915600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T02:30:00.000Z', - key: 1593916200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T02:40:00.000Z', - key: 1593916800000, - doc_count: 37, - pct: { - values: { - '95.0': 348144.0, - '99.0': 3293168.0, - }, - }, - avg: { - value: 160060.1081081081, - }, - }, - { - key_as_string: '2020-07-05T02:50:00.000Z', - key: 1593917400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T03:00:00.000Z', - key: 1593918000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T03:10:00.000Z', - key: 1593918600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T03:20:00.000Z', - key: 1593919200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T03:30:00.000Z', - key: 1593919800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T03:40:00.000Z', - key: 1593920400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T03:50:00.000Z', - key: 1593921000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T04:00:00.000Z', - key: 1593921600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T04:10:00.000Z', - key: 1593922200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T04:20:00.000Z', - key: 1593922800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T04:30:00.000Z', - key: 1593923400000, - doc_count: 64, - pct: { - values: { - '95.0': 270328.0, - '99.0': 299000.0, - }, - }, - avg: { - value: 70357.234375, - }, - }, - { - key_as_string: '2020-07-05T04:40:00.000Z', - key: 1593924000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T04:50:00.000Z', - key: 1593924600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T05:00:00.000Z', - key: 1593925200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T05:10:00.000Z', - key: 1593925800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T05:20:00.000Z', - key: 1593926400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T05:30:00.000Z', - key: 1593927000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T05:40:00.000Z', - key: 1593927600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T05:50:00.000Z', - key: 1593928200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T06:00:00.000Z', - key: 1593928800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T06:10:00.000Z', - key: 1593929400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T06:20:00.000Z', - key: 1593930000000, - doc_count: 83, - pct: { - values: { - '95.0': 1687544.0, - '99.0': 5046264.0, - }, - }, - avg: { - value: 269745.9036144578, - }, - }, - { - key_as_string: '2020-07-05T06:30:00.000Z', - key: 1593930600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T06:40:00.000Z', - key: 1593931200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T06:50:00.000Z', - key: 1593931800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T07:00:00.000Z', - key: 1593932400000, - doc_count: 42, - pct: { - values: { - '95.0': 798656.0, - '99.0': 4292544.0, - }, - }, - avg: { - value: 313349.95238095237, - }, - }, - { - key_as_string: '2020-07-05T07:10:00.000Z', - key: 1593933000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T07:20:00.000Z', - key: 1593933600000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T07:30:00.000Z', - key: 1593934200000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T07:40:00.000Z', - key: 1593934800000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T07:50:00.000Z', - key: 1593935400000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T08:00:00.000Z', - key: 1593936000000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-07-05T08:10:00.000Z', - key: 1593936600000, - doc_count: 215, - pct: { - values: { - '95.0': 3653624.0, - '99.0': 5046264.0, - }, - }, - avg: { - value: 397251.288372093, - }, - }, - { - key_as_string: '2020-07-05T08:20:00.000Z', - key: 1593937200000, - doc_count: 494, - pct: { - values: { - '95.0': 3276768.0, - '99.0': 4292576.0, - }, - }, - avg: { - value: 361953.5931174089, - }, - }, - { - key_as_string: '2020-07-05T08:30:00.000Z', - key: 1593937800000, - doc_count: 518, - pct: { - values: { - '95.0': 522208.0, - '99.0': 4128736.0, - }, - }, - avg: { - value: 259173.0694980695, - }, - }, - { - key_as_string: '2020-07-05T08:40:00.000Z', - key: 1593938400000, - doc_count: 449, - pct: { - values: { - '95.0': 372728.0, - '99.0': 843768.0, - }, - }, - avg: { - value: 79648.20935412026, - }, - }, - ], - }, - overall_avg_duration: { - value: 73065.05176360115, - }, - }, -} as unknown) as ESResponse; diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.test.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.test.ts deleted file mode 100644 index e4baf69eb0263..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.test.ts +++ /dev/null @@ -1,159 +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. - */ - -// /* -// * 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 { timeseriesResponse } from './mock_responses/timeseries_response'; -// import { -// ApmTimeSeriesResponse, -// getThroughputBuckets, -// timeseriesTransformer, -// } from './transform'; - -// describe('timeseriesTransformer', () => { -// let res: ApmTimeSeriesResponse; -// beforeEach(async () => { -// res = await timeseriesTransformer({ -// timeseriesResponse, -// bucketSize: 120, -// durationAsMinutes: 10, -// }); -// }); - -// it('should have correct order', () => { -// expect(res.tpmBuckets.map((bucket) => bucket.key)).toEqual([ -// 'HTTP 2xx', -// 'HTTP 3xx', -// 'HTTP 4xx', -// 'HTTP 5xx', -// 'A Custom Bucket (that should be last)', -// ]); -// }); - -// it('should match snapshot', () => { -// expect(res).toMatchSnapshot(); -// }); -// }); - -// describe('getThroughputBuckets', () => { -// it('should return response', () => { -// const buckets = [ -// { -// key: 'HTTP 4xx', -// doc_count: 300, -// timeseries: { -// buckets: [ -// { -// key_as_string: '', -// key: 0, -// doc_count: 0, -// count: { -// value: 0, -// }, -// }, -// { -// key_as_string: '', -// key: 1, -// doc_count: 200, -// count: { -// value: 200, -// }, -// }, -// { -// key_as_string: '', -// key: 2, -// doc_count: 300, -// count: { -// value: 300, -// }, -// }, -// { -// key_as_string: '', -// key: 3, -// doc_count: 400, -// count: { -// value: 400, -// }, -// }, -// ], -// }, -// }, -// { -// key: 'HTTP 5xx', -// doc_count: 400, -// timeseries: { -// buckets: [ -// { -// key_as_string: '', -// key: 0, -// doc_count: 0, -// count: { -// value: 0, -// }, -// }, -// { -// key_as_string: '', -// key: 1, -// doc_count: 100, -// count: { -// value: 100, -// }, -// }, -// { -// key_as_string: '', -// key: 2, -// doc_count: 100, -// count: { -// value: 100, -// }, -// }, -// { -// key_as_string: '', -// key: 3, -// doc_count: 300, -// count: { -// value: 300, -// }, -// }, -// ], -// }, -// }, -// ]; - -// expect( -// getThroughputBuckets({ -// transactionResultBuckets: buckets, -// bucketSize: 120, -// durationAsMinutes: 10, -// }) -// ).toEqual([ -// { -// avg: 90, -// dataPoints: [ -// { x: 0, y: 0 }, -// { x: 1, y: 100 }, -// { x: 2, y: 150 }, -// { x: 3, y: 200 }, -// ], -// key: 'HTTP 4xx', -// }, -// { -// avg: 50, -// dataPoints: [ -// { x: 0, y: 0 }, -// { x: 1, y: 50 }, -// { x: 2, y: 50 }, -// { x: 3, y: 150 }, -// ], -// key: 'HTTP 5xx', -// }, -// ]); -// }); -// }); diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts index fd5090f9e4f48..6319f219ecee9 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts @@ -71,7 +71,7 @@ async function searchLatency({ size: 0, query: { bool: { filter } }, aggs: { - response_times: { + latency: { date_histogram: { field: '@timestamp', fixed_interval: intervalString, @@ -129,7 +129,7 @@ export async function getLatencyCharts({ overallAvgDuration: response.aggregations.overall_avg_duration.value || null, latency: convertLatencyBucketsToCoordinates( - response.aggregations.response_times.buckets + response.aggregations.latency.buckets ), }; } diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/mock_response/timeseries_response.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/mock_response/timeseries_response.ts new file mode 100644 index 0000000000000..0f65ac66c5ff5 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/mock_response/timeseries_response.ts @@ -0,0 +1,161 @@ +/* + * 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 { LatencyChartsResponse } from '..'; + +export const timeseriesResponse = ({ + took: 34, + timed_out: false, + _shards: { + total: 105, + successful: 105, + skipped: 101, + failed: 0, + }, + hits: { + total: { + value: 18, + relation: 'eq', + }, + max_score: null, + hits: [], + }, + aggregations: { + latency: { + buckets: [ + { + key_as_string: '2020-12-07T13:00:30.000Z', + key: 1607346030000, + doc_count: 1, + pct: { + values: { + '95.0': 13888.0, + '99.0': 13888.0, + }, + }, + avg: { + value: 13942.0, + }, + }, + { + key_as_string: '2020-12-07T13:01:00.000Z', + key: 1607346060000, + doc_count: 3, + pct: { + values: { + '95.0': 23552.0, + '99.0': 23552.0, + }, + }, + avg: { + value: 19322.333333333332, + }, + }, + { + key_as_string: '2020-12-07T13:01:30.000Z', + key: 1607346090000, + doc_count: 0, + pct: { + values: { + '95.0': null, + '99.0': null, + }, + }, + avg: { + value: null, + }, + }, + { + key_as_string: '2020-12-07T13:02:00.000Z', + key: 1607346120000, + doc_count: 8, + pct: { + values: { + '95.0': 378864.0, + '99.0': 378864.0, + }, + }, + avg: { + value: 68323.875, + }, + }, + { + key_as_string: '2020-12-07T13:02:30.000Z', + key: 1607346150000, + doc_count: 3, + pct: { + values: { + '95.0': 7.392448e7, + '99.0': 7.392448e7, + }, + }, + avg: { + value: 2.5222877333333332e7, + }, + }, + { + key_as_string: '2020-12-07T13:03:00.000Z', + key: 1607346180000, + doc_count: 0, + pct: { + values: { + '95.0': null, + '99.0': null, + }, + }, + avg: { + value: null, + }, + }, + { + key_as_string: '2020-12-07T13:03:30.000Z', + key: 1607346210000, + doc_count: 0, + pct: { + values: { + '95.0': null, + '99.0': null, + }, + }, + avg: { + value: null, + }, + }, + { + key_as_string: '2020-12-07T13:04:00.000Z', + key: 1607346240000, + doc_count: 2, + pct: { + values: { + '95.0': 38016.0, + '99.0': 38016.0, + }, + }, + avg: { + value: 29134.0, + }, + }, + { + key_as_string: '2020-12-07T13:04:30.000Z', + key: 1607346270000, + doc_count: 1, + pct: { + values: { + '95.0': 9792.0, + '99.0': 9792.0, + }, + }, + avg: { + value: 9837.0, + }, + }, + ], + }, + overall_avg_duration: { + value: 4241957.611111111, + }, + }, +} as unknown) as LatencyChartsResponse; diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.test.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.test.ts new file mode 100644 index 0000000000000..a9ebc4d67a88d --- /dev/null +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.test.ts @@ -0,0 +1,56 @@ +/* + * 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 { timeseriesResponse } from './mock_response/timeseries_response'; +import { convertLatencyBucketsToCoordinates } from './transform'; + +describe('convertLatencyBucketsToCoordinates', () => { + it('returns default value when latency buckets is undefined', () => { + const latency = convertLatencyBucketsToCoordinates(); + expect(latency).toEqual({ avg: [], p95: [], p99: [] }); + }); + + it('returns latecy coordinates', () => { + const latency = convertLatencyBucketsToCoordinates( + timeseriesResponse.aggregations?.latency.buckets + ); + expect(latency).toEqual({ + avg: [ + { x: 1607346030000, y: 13942 }, + { x: 1607346060000, y: 19322.333333333332 }, + { x: 1607346090000, y: null }, + { x: 1607346120000, y: 68323.875 }, + { x: 1607346150000, y: 25222877.333333332 }, + { x: 1607346180000, y: null }, + { x: 1607346210000, y: null }, + { x: 1607346240000, y: 29134 }, + { x: 1607346270000, y: 9837 }, + ], + p95: [ + { x: 1607346030000, y: 13888 }, + { x: 1607346060000, y: 23552 }, + { x: 1607346090000, y: null }, + { x: 1607346120000, y: 378864 }, + { x: 1607346150000, y: 73924480 }, + { x: 1607346180000, y: null }, + { x: 1607346210000, y: null }, + { x: 1607346240000, y: 38016 }, + { x: 1607346270000, y: 9792 }, + ], + p99: [ + { x: 1607346030000, y: 13888 }, + { x: 1607346060000, y: 23552 }, + { x: 1607346090000, y: null }, + { x: 1607346120000, y: 378864 }, + { x: 1607346150000, y: 73924480 }, + { x: 1607346180000, y: null }, + { x: 1607346210000, y: null }, + { x: 1607346240000, y: 38016 }, + { x: 1607346270000, y: 9792 }, + ], + }); + }); +}); diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts index 81eb0b94a58e5..9971fb289a1cb 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts @@ -8,7 +8,7 @@ import { isNumber } from 'lodash'; import { LatencyChartsResponse } from '.'; import { Coordinate } from '../../../../typings/timeseries'; -type LatencyBuckets = Required['aggregations']['response_times']['buckets']; +type LatencyBuckets = Required['aggregations']['latency']['buckets']; export function convertLatencyBucketsToCoordinates( latencyBuckets: LatencyBuckets = [] diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts index a3878d21db031..cb289a091601e 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts @@ -75,7 +75,7 @@ async function searchThroughput({ size: 0, query: { bool: { filter } }, aggs: { - transaction_results: { + throughput: { terms: { field: TRANSACTION_RESULT, missing: '' }, aggs: { timeseries: { @@ -128,8 +128,7 @@ export async function getThroughputCharts({ return { throughput: getThroughputBuckets({ - transactionResultBuckets: - response.aggregations.transaction_results.buckets, + throughputResultBuckets: response.aggregations.throughput.buckets, bucketSize, durationAsMinutes, }), diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/mock_response/timeseries_response.ts b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/mock_response/timeseries_response.ts new file mode 100644 index 0000000000000..dcbc4ad47a7b4 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/mock_response/timeseries_response.ts @@ -0,0 +1,239 @@ +/* + * 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 { ThroughputChartsResponse } from '..'; + +export const timeseriesResponse = ({ + took: 43, + timed_out: false, + _shards: { + total: 105, + successful: 105, + skipped: 101, + failed: 0, + }, + hits: { + total: { + value: 16, + relation: 'eq', + }, + max_score: null, + hits: [], + }, + aggregations: { + throughput: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'A Custom Bucket (that should be last)', + doc_count: 0, + timeseries: { buckets: [] }, + }, + { + key: 'HTTP 2xx', + doc_count: 9, + timeseries: { + buckets: [ + { + key_as_string: '2020-12-07T13:02:00.000Z', + key: 1607346120000, + doc_count: 1, + count: { + value: 1, + }, + }, + { + key_as_string: '2020-12-07T13:02:30.000Z', + key: 1607346150000, + doc_count: 2, + count: { + value: 2, + }, + }, + { + key_as_string: '2020-12-07T13:03:00.000Z', + key: 1607346180000, + doc_count: 0, + count: { + value: 0, + }, + }, + { + key_as_string: '2020-12-07T13:03:30.000Z', + key: 1607346210000, + doc_count: 0, + count: { + value: 0, + }, + }, + { + key_as_string: '2020-12-07T13:04:00.000Z', + key: 1607346240000, + doc_count: 2, + count: { + value: 2, + }, + }, + { + key_as_string: '2020-12-07T13:04:30.000Z', + key: 1607346270000, + doc_count: 1, + count: { + value: 1, + }, + }, + { + key_as_string: '2020-12-07T13:05:00.000Z', + key: 1607346300000, + doc_count: 0, + count: { + value: 0, + }, + }, + { + key_as_string: '2020-12-07T13:05:30.000Z', + key: 1607346330000, + doc_count: 1, + count: { + value: 1, + }, + }, + { + key_as_string: '2020-12-07T13:06:00.000Z', + key: 1607346360000, + doc_count: 2, + count: { + value: 2, + }, + }, + ], + }, + }, + { + key: 'HTTP 5xx', + doc_count: 5, + timeseries: { + buckets: [ + { + key_as_string: '2020-12-07T13:02:00.000Z', + key: 1607346120000, + doc_count: 3, + count: { + value: 3, + }, + }, + { + key_as_string: '2020-12-07T13:02:30.000Z', + key: 1607346150000, + doc_count: 1, + count: { + value: 1, + }, + }, + { + key_as_string: '2020-12-07T13:03:00.000Z', + key: 1607346180000, + doc_count: 0, + count: { + value: 0, + }, + }, + { + key_as_string: '2020-12-07T13:03:30.000Z', + key: 1607346210000, + doc_count: 0, + count: { + value: 0, + }, + }, + { + key_as_string: '2020-12-07T13:04:00.000Z', + key: 1607346240000, + doc_count: 0, + count: { + value: 0, + }, + }, + { + key_as_string: '2020-12-07T13:04:30.000Z', + key: 1607346270000, + doc_count: 0, + count: { + value: 0, + }, + }, + { + key_as_string: '2020-12-07T13:05:00.000Z', + key: 1607346300000, + doc_count: 0, + count: { + value: 0, + }, + }, + { + key_as_string: '2020-12-07T13:05:30.000Z', + key: 1607346330000, + doc_count: 0, + count: { + value: 0, + }, + }, + { + key_as_string: '2020-12-07T13:06:00.000Z', + key: 1607346360000, + doc_count: 0, + count: { + value: 0, + }, + }, + { + key_as_string: '2020-12-07T13:06:30.000Z', + key: 1607346390000, + doc_count: 1, + count: { + value: 1, + }, + }, + ], + }, + }, + { + key: 'HTTP 4xx', + doc_count: 2, + timeseries: { + buckets: [ + { + key_as_string: '2020-12-07T13:02:00.000Z', + key: 1607346120000, + doc_count: 2, + count: { + value: 2, + }, + }, + ], + }, + }, + { + key: 'HTTP 3xx', + doc_count: 2, + timeseries: { + buckets: [ + { + key_as_string: '2020-12-07T13:02:00.000Z', + key: 1607346120000, + doc_count: 2, + count: { + value: 2, + }, + }, + ], + }, + }, + ], + }, + }, +} as unknown) as ThroughputChartsResponse; diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.test.ts b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.test.ts new file mode 100644 index 0000000000000..8207e33b4ef99 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.test.ts @@ -0,0 +1,125 @@ +/* + * 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 { timeseriesResponse } from './mock_response/timeseries_response'; +import { getThroughputBuckets } from './transform'; + +describe('getThroughputBuckets', () => { + const bucketSize = 30; + const durationAsMinutes = 10; + + it('should have correct order', () => { + const throughput = getThroughputBuckets({ + throughputResultBuckets: + timeseriesResponse.aggregations?.throughput.buckets, + bucketSize, + durationAsMinutes, + }); + expect(throughput.map((bucket) => bucket.key)).toEqual([ + 'HTTP 2xx', + 'HTTP 3xx', + 'HTTP 4xx', + 'HTTP 5xx', + 'A Custom Bucket (that should be last)', + ]); + }); + + it('calculates the thoughput based bucket size and duration', () => { + const buckets = [ + { + key: 'HTTP 4xx', + doc_count: 300, + timeseries: { + buckets: [ + { + key_as_string: '', + key: 0, + doc_count: 0, + count: { value: 0 }, + }, + { + key_as_string: '', + key: 1, + doc_count: 200, + count: { value: 200 }, + }, + { + key_as_string: '', + key: 2, + doc_count: 300, + count: { value: 300 }, + }, + { + key_as_string: '', + key: 3, + doc_count: 400, + count: { value: 400 }, + }, + ], + }, + }, + { + key: 'HTTP 5xx', + doc_count: 400, + timeseries: { + buckets: [ + { + key_as_string: '', + key: 0, + doc_count: 0, + count: { value: 0 }, + }, + { + key_as_string: '', + key: 1, + doc_count: 100, + count: { value: 100 }, + }, + { + key_as_string: '', + key: 2, + doc_count: 100, + count: { value: 100 }, + }, + { + key_as_string: '', + key: 3, + doc_count: 300, + count: { value: 300 }, + }, + ], + }, + }, + ]; + const throuput = getThroughputBuckets({ + throughputResultBuckets: buckets, + bucketSize: 120, + durationAsMinutes: 10, + }); + expect(throuput).toEqual([ + { + avg: 90, + dataPoints: [ + { x: 0, y: 0 }, + { x: 1, y: 100 }, + { x: 2, y: 150 }, + { x: 3, y: 200 }, + ], + key: 'HTTP 4xx', + }, + { + avg: 50, + dataPoints: [ + { x: 0, y: 0 }, + { x: 1, y: 50 }, + { x: 2, y: 50 }, + { x: 3, y: 150 }, + ], + key: 'HTTP 5xx', + }, + ]); + }); +}); diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.ts b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.ts index 3a71253a447be..0ebf1446265fd 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.ts @@ -8,18 +8,18 @@ import { sortBy } from 'lodash'; import { NOT_AVAILABLE_LABEL } from '../../../../common/i18n'; import { ThroughputChartsResponse } from '.'; -type TransactionResultBuckets = Required['aggregations']['transaction_results']['buckets']; +type ThroughputResultBuckets = Required['aggregations']['throughput']['buckets']; export function getThroughputBuckets({ - transactionResultBuckets = [], + throughputResultBuckets = [], bucketSize, durationAsMinutes, }: { - transactionResultBuckets: TransactionResultBuckets; + throughputResultBuckets?: ThroughputResultBuckets; bucketSize: number; durationAsMinutes: number; }) { - const buckets = transactionResultBuckets.map( + const buckets = throughputResultBuckets.map( ({ key: resultKey, timeseries }) => { const dataPoints = timeseries.buckets.map((bucket) => { return { From 49ddef7cc154ff8d8216453f640339a4d6e89248 Mon Sep 17 00:00:00 2001 From: cauemarcondes Date: Tue, 8 Dec 2020 11:02:52 +0100 Subject: [PATCH 03/10] fixing UI --- .../app/TransactionDetails/index.tsx | 12 +- .../app/transaction_overview/index.tsx | 12 +- .../shared/charts/timeseries_chart.tsx | 6 +- .../charts/transaction_charts/index.tsx | 46 +-- ... use_transaction_latency_chart_fetcher.ts} | 19 +- ...se_transaction_throughput_chart_fetcher.ts | 54 ++++ .../public/selectors/chart_selectors.test.ts | 269 ------------------ .../apm/public/selectors/chart_selectors.ts | 213 -------------- .../selectors/latency_chart_selector.test.ts | 128 +++++++++ .../selectors/latency_chart_selectors.ts | 145 ++++++++++ .../throuput_chart_selectors.test.ts | 72 +++++ .../selectors/throuput_chart_selectors.ts | 90 ++++++ .../transactions/get_latency_charts/index.ts | 6 +- .../mock_response/timeseries_response.ts | 4 +- .../get_latency_charts/transform.ts | 4 +- .../get_throughput_charts/index.ts | 6 +- .../transactions/transactions_routes.ts | 72 +---- 17 files changed, 550 insertions(+), 608 deletions(-) rename x-pack/plugins/apm/public/hooks/{use_transaction_charts_fetcher.ts => use_transaction_latency_chart_fetcher.ts} (70%) create mode 100644 x-pack/plugins/apm/public/hooks/use_transaction_throughput_chart_fetcher.ts delete mode 100644 x-pack/plugins/apm/public/selectors/chart_selectors.test.ts delete mode 100644 x-pack/plugins/apm/public/selectors/chart_selectors.ts create mode 100644 x-pack/plugins/apm/public/selectors/latency_chart_selector.test.ts create mode 100644 x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts create mode 100644 x-pack/plugins/apm/public/selectors/throuput_chart_selectors.test.ts create mode 100644 x-pack/plugins/apm/public/selectors/throuput_chart_selectors.ts diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/index.tsx b/x-pack/plugins/apm/public/components/app/TransactionDetails/index.tsx index c491b9f0e1eff..6810b56fb8f87 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/index.tsx +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/index.tsx @@ -17,7 +17,6 @@ import React, { useMemo } from 'react'; import { isEmpty, flatten } from 'lodash'; import { useHistory } from 'react-router-dom'; import { RouteComponentProps } from 'react-router-dom'; -import { useTransactionChartsFetcher } from '../../../hooks/use_transaction_charts_fetcher'; import { useTransactionDistributionFetcher } from '../../../hooks/use_transaction_distribution_fetcher'; import { useWaterfallFetcher } from './use_waterfall_fetcher'; import { ApmHeader } from '../../shared/ApmHeader'; @@ -54,11 +53,6 @@ export function TransactionDetails({ distributionStatus, } = useTransactionDistributionFetcher(); - const { - transactionChartsData, - transactionChartsStatus, - } = useTransactionChartsFetcher(); - const { waterfall, exceedsMax, @@ -128,11 +122,7 @@ export function TransactionDetails({ - + diff --git a/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx index 9ff4ad916b174..ad2b68ae8a4ef 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx @@ -24,7 +24,6 @@ import { useTrackPageview } from '../../../../../observability/public'; import { Projection } from '../../../../common/projections'; import { TRANSACTION_PAGE_LOAD } from '../../../../common/transaction_types'; import { IUrlParams } from '../../../context/url_params_context/types'; -import { useTransactionChartsFetcher } from '../../../hooks/use_transaction_charts_fetcher'; import { useTransactionListFetcher } from './use_transaction_list'; import { useUrlParams } from '../../../context/url_params_context/use_url_params'; import { TransactionCharts } from '../../shared/charts/transaction_charts'; @@ -73,11 +72,6 @@ export function TransactionOverview({ serviceName }: TransactionOverviewProps) { // redirect to first transaction type useRedirect(getRedirectLocation({ location, transactionType, urlParams })); - const { - transactionChartsData, - transactionChartsStatus, - } = useTransactionChartsFetcher(); - useTrackPageview({ app: 'apm', path: 'transaction_overview' }); useTrackPageview({ app: 'apm', path: 'transaction_overview', delay: 15000 }); const { @@ -132,11 +126,7 @@ export function TransactionOverview({ serviceName }: TransactionOverviewProps) { )} - + diff --git a/x-pack/plugins/apm/public/components/shared/charts/timeseries_chart.tsx b/x-pack/plugins/apm/public/components/shared/charts/timeseries_chart.tsx index 947a3a6e89bd1..afc8951f121ea 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/timeseries_chart.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/timeseries_chart.tsx @@ -34,10 +34,10 @@ import { useTheme } from '../../../hooks/use_theme'; import { useUrlParams } from '../../../context/url_params_context/use_url_params'; import { useAnnotationsContext } from '../../../context/annotations/use_annotations_context'; import { useChartPointerEventContext } from '../../../context/chart_pointer_event/use_chart_pointer_event_context'; -import { AnomalySeries } from '../../../selectors/chart_selectors'; import { unit } from '../../../style/variables'; import { ChartContainer } from './chart_container'; import { onBrushEnd } from './helper/helper'; +import { getLatencyChartSelector } from '../../../selectors/latency_chart_selectors'; interface Props { id: string; @@ -55,7 +55,9 @@ interface Props { yTickFormat?: (y: number) => string; showAnnotations?: boolean; yDomain?: YDomainRange; - anomalySeries?: AnomalySeries; + anomalySeries?: ReturnType< + typeof getLatencyChartSelector + >['anomalyTimeseries']; } export function TimeseriesChart({ diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx index bb7c0a9104fc7..f43019a5101d0 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx @@ -23,9 +23,9 @@ import { asTransactionRate } from '../../../../../common/utils/formatters'; import { AnnotationsContextProvider } from '../../../../context/annotations/annotations_context'; import { ChartPointerEventContextProvider } from '../../../../context/chart_pointer_event/chart_pointer_event_context'; import { LicenseContext } from '../../../../context/license/license_context'; -import type { IUrlParams } from '../../../../context/url_params_context/types'; -import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; -import { ITransactionChartData } from '../../../../selectors/chart_selectors'; +import { useUrlParams } from '../../../../context/url_params_context/use_url_params'; +import { useTransactionLatencyChartsFetcher } from '../../../../hooks/use_transaction_latency_chart_fetcher'; +import { useTransactionThroughputChartsFetcher } from '../../../../hooks/use_transaction_throughput_chart_fetcher'; import { TimeseriesChart } from '../timeseries_chart'; import { TransactionBreakdownChart } from '../transaction_breakdown_chart'; import { TransactionErrorRateChart } from '../transaction_error_rate_chart/'; @@ -33,22 +33,24 @@ import { getResponseTimeTickFormatter } from './helper'; import { MLHeader } from './ml_header'; import { useFormatter } from './use_formatter'; -interface TransactionChartProps { - charts: ITransactionChartData; - urlParams: IUrlParams; - fetchStatus: FETCH_STATUS; -} - -export function TransactionCharts({ - charts, - urlParams, - fetchStatus, -}: TransactionChartProps) { +export function TransactionCharts() { + const { urlParams } = useUrlParams(); const { transactionType } = urlParams; - const { responseTimeSeries, tpmSeries, anomalySeries } = charts; + const { + latencyChartsData, + latencyChartsStatus, + } = useTransactionLatencyChartsFetcher(); + + const { + throughputChartsData, + throughputChartsStatus, + } = useTransactionThroughputChartsFetcher(); + + const { latencyTimeseries, anomalyTimeseries, mlJobId } = latencyChartsData; + const { throughputTimeseries } = throughputChartsData; - const { formatter, toggleSerie } = useFormatter(responseTimeSeries); + const { formatter, toggleSerie } = useFormatter(latencyTimeseries); return ( <> @@ -69,17 +71,17 @@ export function TransactionCharts({ hasValidMlLicense={ license?.getFeature('ml').isAvailable } - mlJobId={charts.mlJobId} + mlJobId={mlJobId} /> )} { if (serie) { toggleSerie(serie); @@ -95,9 +97,9 @@ export function TransactionCharts({ {tpmLabel(transactionType)} diff --git a/x-pack/plugins/apm/public/hooks/use_transaction_charts_fetcher.ts b/x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts similarity index 70% rename from x-pack/plugins/apm/public/hooks/use_transaction_charts_fetcher.ts rename to x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts index 406a1a4633577..2434ec9c977ed 100644 --- a/x-pack/plugins/apm/public/hooks/use_transaction_charts_fetcher.ts +++ b/x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts @@ -6,12 +6,14 @@ import { useMemo } from 'react'; import { useParams } from 'react-router-dom'; -import { getTransactionCharts } from '../selectors/chart_selectors'; import { useFetcher } from './use_fetcher'; import { useUrlParams } from '../context/url_params_context/use_url_params'; +import { getLatencyChartSelector } from '../selectors/latency_chart_selectors'; +import { useTheme } from './use_theme'; -export function useTransactionChartsFetcher() { +export function useTransactionLatencyChartsFetcher() { const { serviceName } = useParams<{ serviceName?: string }>(); + const theme = useTheme(); const { urlParams: { transactionType, start, end, transactionName }, uiFilters, @@ -21,7 +23,8 @@ export function useTransactionChartsFetcher() { (callApmApi) => { if (serviceName && start && end) { return callApmApi({ - endpoint: 'GET /api/apm/services/{serviceName}/transactions/charts', + endpoint: + 'GET /api/apm/services/{serviceName}/transactions/charts/latency', params: { path: { serviceName }, query: { @@ -39,13 +42,13 @@ export function useTransactionChartsFetcher() { ); const memoizedData = useMemo( - () => getTransactionCharts({ transactionType }, data), - [data, transactionType] + () => getLatencyChartSelector({ latencyChart: data, theme }), + [data, theme] ); return { - transactionChartsData: memoizedData, - transactionChartsStatus: status, - transactionChartsError: error, + latencyChartsData: memoizedData, + latencyChartsStatus: status, + latencyChartsError: error, }; } diff --git a/x-pack/plugins/apm/public/hooks/use_transaction_throughput_chart_fetcher.ts b/x-pack/plugins/apm/public/hooks/use_transaction_throughput_chart_fetcher.ts new file mode 100644 index 0000000000000..c03bb8efc79b3 --- /dev/null +++ b/x-pack/plugins/apm/public/hooks/use_transaction_throughput_chart_fetcher.ts @@ -0,0 +1,54 @@ +/* + * 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 { useMemo } from 'react'; +import { useParams } from 'react-router-dom'; +import { useFetcher } from './use_fetcher'; +import { useUrlParams } from '../context/url_params_context/use_url_params'; +import { getThrouputChartSelector } from '../selectors/throuput_chart_selectors'; +import { useTheme } from './use_theme'; + +export function useTransactionThroughputChartsFetcher() { + const { serviceName } = useParams<{ serviceName?: string }>(); + const theme = useTheme(); + const { + urlParams: { transactionType, start, end, transactionName }, + uiFilters, + } = useUrlParams(); + + const { data, error, status } = useFetcher( + (callApmApi) => { + if (serviceName && start && end) { + return callApmApi({ + endpoint: + 'GET /api/apm/services/{serviceName}/transactions/charts/throughput', + params: { + path: { serviceName }, + query: { + start, + end, + transactionType, + transactionName, + uiFilters: JSON.stringify(uiFilters), + }, + }, + }); + } + }, + [serviceName, start, end, transactionName, transactionType, uiFilters] + ); + + const memoizedData = useMemo( + () => getThrouputChartSelector({ throuputChart: data, theme }), + [data, theme] + ); + + return { + throughputChartsData: memoizedData, + throughputChartsStatus: status, + throughputChartsError: error, + }; +} diff --git a/x-pack/plugins/apm/public/selectors/chart_selectors.test.ts b/x-pack/plugins/apm/public/selectors/chart_selectors.test.ts deleted file mode 100644 index c9e6177f2c721..0000000000000 --- a/x-pack/plugins/apm/public/selectors/chart_selectors.test.ts +++ /dev/null @@ -1,269 +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 theme from '@elastic/eui/dist/eui_theme_light.json'; -import { - getAnomalyScoreSeries, - getResponseTimeSeries, - getTpmSeries, -} from './chart_selectors'; -import { - successColor, - warningColor, - errorColor, -} from '../utils/httpStatusCodeToColor'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { ApmTimeSeriesResponse } from '../../server/lib/transactions/charts/get_timeseries_data/transform'; - -describe('chart selectors', () => { - describe('getAnomalyScoreSeries', () => { - it('should return anomalyScoreSeries', () => { - const data = [{ x0: 0, x: 10 }]; - expect(getAnomalyScoreSeries(data)).toEqual({ - color: '#e7664c', - data: [{ x0: 0, x: 10 }], - title: 'Anomaly score', - type: 'rectAnnotation', - }); - }); - }); - - describe('getResponseTimeSeries', () => { - const apmTimeseries = { - responseTimes: { - avg: [ - { x: 0, y: 100 }, - { x: 1000, y: 200 }, - ], - p95: [ - { x: 0, y: 200 }, - { x: 1000, y: 300 }, - ], - p99: [ - { x: 0, y: 300 }, - { x: 1000, y: 400 }, - ], - }, - tpmBuckets: [], - overallAvgDuration: 200, - }; - - it('should produce correct series', () => { - expect(getResponseTimeSeries({ apmTimeseries })).toEqual([ - { - color: '#6092c0', - data: [ - { x: 0, y: 100 }, - { x: 1000, y: 200 }, - ], - legendValue: '200 μs', - title: 'Avg.', - type: 'linemark', - }, - { - color: '#d6bf57', - data: [ - { x: 0, y: 200 }, - { x: 1000, y: 300 }, - ], - title: '95th percentile', - titleShort: '95th', - type: 'linemark', - }, - { - color: '#da8b45', - data: [ - { x: 0, y: 300 }, - { x: 1000, y: 400 }, - ], - title: '99th percentile', - titleShort: '99th', - type: 'linemark', - }, - ]); - }); - - it('should return 3 series', () => { - expect(getResponseTimeSeries({ apmTimeseries }).length).toBe(3); - }); - }); - - describe('getTpmSeries', () => { - const apmTimeseries: ApmTimeSeriesResponse = { - responseTimes: { - avg: [], - p95: [], - p99: [], - }, - tpmBuckets: [ - { - key: 'HTTP 2xx', - avg: 3.5, - dataPoints: [ - { x: 0, y: 5 }, - { x: 1, y: 2 }, - ], - }, - { key: 'HTTP 4xx', avg: 1, dataPoints: [{ x: 0, y: 1 }] }, - { key: 'HTTP 5xx', avg: 0, dataPoints: [{ x: 0, y: 0 }] }, - ], - overallAvgDuration: 200, - }; - const transactionType = 'MyTransactionType'; - - it('produces correct series', () => { - expect(getTpmSeries(apmTimeseries, transactionType)).toEqual([ - { - color: successColor, - data: [ - { x: 0, y: 5 }, - { x: 1, y: 2 }, - ], - legendValue: '3.5 tpm', - title: 'HTTP 2xx', - type: 'linemark', - }, - { - color: warningColor, - data: [{ x: 0, y: 1 }], - legendValue: '1.0 tpm', - title: 'HTTP 4xx', - type: 'linemark', - }, - { - color: errorColor, - data: [{ x: 0, y: 0 }], - legendValue: '0 tpm', - title: 'HTTP 5xx', - type: 'linemark', - }, - ]); - }); - - describe('with success buckets', () => { - it('uses a success color', () => { - const key = 'it was a success'; - expect( - getTpmSeries({ - ...apmTimeseries, - tpmBuckets: [{ key, avg: 0, dataPoints: [{ x: 0, y: 0 }] }], - })[0].color - ).toEqual(theme.euiColorSecondary); - }); - }); - - describe('with SUCESS buckets', () => { - it('uses a success color', () => { - const key = 'it was a Success'; - expect( - getTpmSeries({ - ...apmTimeseries, - tpmBuckets: [{ key, avg: 0, dataPoints: [{ x: 0, y: 0 }] }], - })[0].color - ).toEqual(theme.euiColorSecondary); - }); - }); - - describe('with ok buckets', () => { - it('uses a success color', () => { - const key = 'it was ok'; - expect( - getTpmSeries({ - ...apmTimeseries, - tpmBuckets: [{ key, avg: 0, dataPoints: [{ x: 0, y: 0 }] }], - })[0].color - ).toEqual(theme.euiColorSecondary); - }); - }); - - describe('with OK buckets', () => { - it('uses a success color', () => { - const key = 'it was OK'; - expect( - getTpmSeries({ - ...apmTimeseries, - tpmBuckets: [{ key, avg: 0, dataPoints: [{ x: 0, y: 0 }] }], - })[0].color - ).toEqual(theme.euiColorSecondary); - }); - }); - - describe('with fail buckets', () => { - it('uses a failure color', () => { - const key = 'it failed'; - expect( - getTpmSeries({ - ...apmTimeseries, - tpmBuckets: [{ key, avg: 0, dataPoints: [{ x: 0, y: 0 }] }], - })[0].color - ).toEqual(theme.euiColorDanger); - }); - }); - - describe('with FAIL buckets', () => { - it('uses a failure color', () => { - const key = 'it FAILED'; - expect( - getTpmSeries({ - ...apmTimeseries, - tpmBuckets: [{ key, avg: 0, dataPoints: [{ x: 0, y: 0 }] }], - })[0].color - ).toEqual(theme.euiColorDanger); - }); - }); - - describe('with error buckets', () => { - it('uses a failure color', () => { - const key = 'Quizás fuera un error'; - expect( - getTpmSeries({ - ...apmTimeseries, - tpmBuckets: [{ key, avg: 0, dataPoints: [{ x: 0, y: 0 }] }], - })[0].color - ).toEqual(theme.euiColorDanger); - }); - }); - - describe('with ERROR buckets', () => { - it('uses a failure color', () => { - const key = 'Quizás fuera un ErroR'; - expect( - getTpmSeries({ - ...apmTimeseries, - tpmBuckets: [{ key, avg: 0, dataPoints: [{ x: 0, y: 0 }] }], - })[0].color - ).toEqual(theme.euiColorDanger); - }); - }); - - describe('when empty', () => { - it('produces an empty series', () => { - const responseTimes = { - avg: [ - { x: 0, y: 1 }, - { x: 100, y: 1 }, - ], - p95: [ - { x: 0, y: 1 }, - { x: 100, y: 1 }, - ], - p99: [ - { x: 0, y: 1 }, - { x: 100, y: 1 }, - ], - }; - const series = getTpmSeries( - { ...apmTimeseries, responseTimes, tpmBuckets: [] }, - transactionType - ); - - expect(series[0].data.length).toBe(11); - expect(series[0].data[0].x).toBe(0); - expect(series[0].data[10].x).toBe(100); - }); - }); - }); -}); diff --git a/x-pack/plugins/apm/public/selectors/chart_selectors.ts b/x-pack/plugins/apm/public/selectors/chart_selectors.ts deleted file mode 100644 index 37bd04e5d9980..0000000000000 --- a/x-pack/plugins/apm/public/selectors/chart_selectors.ts +++ /dev/null @@ -1,213 +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 theme from '@elastic/eui/dist/eui_theme_light.json'; -import { i18n } from '@kbn/i18n'; -import { difference, zipObject } from 'lodash'; -import { rgba } from 'polished'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { TimeSeriesAPIResponse } from '../../server/lib/transactions/charts'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { ApmTimeSeriesResponse } from '../../server/lib/transactions/charts/get_timeseries_data/transform'; -import { - Coordinate, - RectCoordinate, - TimeSeries, -} from '../../typings/timeseries'; -import { IUrlParams } from '../context/url_params_context/types'; -import { getEmptySeries } from '../components/shared/charts/helper/get_empty_series'; -import { httpStatusCodeToColor } from '../utils/httpStatusCodeToColor'; -import { asDuration, asTransactionRate } from '../../common/utils/formatters'; - -export interface ITpmBucket { - title: string; - data: Coordinate[]; - legendValue: string; - type: string; - color: string; -} - -export interface AnomalySeries { - scores: TimeSeries; - bounderies: TimeSeries; -} - -export interface ITransactionChartData { - tpmSeries?: ITpmBucket[]; - responseTimeSeries?: TimeSeries[]; - mlJobId: string | undefined; - anomalySeries?: AnomalySeries; -} - -const INITIAL_DATA: Partial = { - apmTimeseries: undefined, - anomalyTimeseries: undefined, -}; - -export function getTransactionCharts( - { transactionType }: IUrlParams, - charts = INITIAL_DATA -): ITransactionChartData { - const { apmTimeseries, anomalyTimeseries } = charts; - - const transactionCharts: ITransactionChartData = { - tpmSeries: undefined, - responseTimeSeries: undefined, - mlJobId: anomalyTimeseries?.jobId, - }; - - if (apmTimeseries) { - transactionCharts.tpmSeries = getTpmSeries(apmTimeseries, transactionType); - - transactionCharts.responseTimeSeries = getResponseTimeSeries({ - apmTimeseries, - }); - - transactionCharts.anomalySeries = getResponseTimeAnnomalySeries({ - anomalyTimeseries, - }); - } - return transactionCharts; -} - -function getResponseTimeAnnomalySeries({ - anomalyTimeseries, -}: { - anomalyTimeseries: TimeSeriesAPIResponse['anomalyTimeseries']; -}): AnomalySeries | undefined { - if (anomalyTimeseries) { - return { - bounderies: getAnomalyBoundariesSeries( - anomalyTimeseries.anomalyBoundaries - ), - scores: getAnomalyScoreSeries(anomalyTimeseries.anomalyScore), - }; - } -} - -export function getResponseTimeSeries({ - apmTimeseries, -}: { - apmTimeseries: TimeSeriesAPIResponse['apmTimeseries']; -}) { - const { overallAvgDuration } = apmTimeseries; - const { avg, p95, p99 } = apmTimeseries.responseTimes; - - const series: TimeSeries[] = [ - { - title: i18n.translate('xpack.apm.transactions.chart.averageLabel', { - defaultMessage: 'Avg.', - }), - data: avg, - legendValue: asDuration(overallAvgDuration), - type: 'linemark', - color: theme.euiColorVis1, - }, - { - title: i18n.translate( - 'xpack.apm.transactions.chart.95thPercentileLabel', - { - defaultMessage: '95th percentile', - } - ), - titleShort: '95th', - data: p95, - type: 'linemark', - color: theme.euiColorVis5, - }, - { - title: i18n.translate( - 'xpack.apm.transactions.chart.99thPercentileLabel', - { - defaultMessage: '99th percentile', - } - ), - titleShort: '99th', - data: p99, - type: 'linemark', - color: theme.euiColorVis7, - }, - ]; - - return series; -} - -export function getAnomalyScoreSeries(data: RectCoordinate[]) { - return { - title: i18n.translate('xpack.apm.transactions.chart.anomalyScoreLabel', { - defaultMessage: 'Anomaly score', - }), - data, - type: 'rectAnnotation', - color: theme.euiColorVis9, - }; -} - -function getAnomalyBoundariesSeries(data: Coordinate[]) { - return { - title: i18n.translate( - 'xpack.apm.transactions.chart.anomalyBoundariesLabel', - { - defaultMessage: 'Anomaly Boundaries', - } - ), - data, - type: 'area', - color: rgba(theme.euiColorVis1, 0.5), - }; -} - -export function getTpmSeries( - apmTimeseries: ApmTimeSeriesResponse, - transactionType?: string -) { - const { tpmBuckets } = apmTimeseries; - const bucketKeys = tpmBuckets.map(({ key }) => key); - const getColor = getColorByKey(bucketKeys); - - const { avg } = apmTimeseries.responseTimes; - - if (!tpmBuckets.length && avg.length) { - const start = avg[0].x; - const end = avg[avg.length - 1].x; - return getEmptySeries(start, end); - } - - return tpmBuckets.map((bucket) => { - return { - title: bucket.key, - data: bucket.dataPoints, - legendValue: asTransactionRate(bucket.avg), - type: 'linemark', - color: getColor(bucket.key), - }; - }); -} - -function colorMatch(key: string) { - if (/ok|success/i.test(key)) { - return theme.euiColorSecondary; - } else if (/error|fail/i.test(key)) { - return theme.euiColorDanger; - } -} - -function getColorByKey(keys: string[]) { - const assignedColors = ['HTTP 2xx', 'HTTP 3xx', 'HTTP 4xx', 'HTTP 5xx']; - - const unknownKeys = difference(keys, assignedColors); - const unassignedColors: Record = zipObject(unknownKeys, [ - theme.euiColorVis1, - theme.euiColorVis3, - theme.euiColorVis4, - theme.euiColorVis6, - theme.euiColorVis2, - theme.euiColorVis8, - ]); - - return (key: string) => - colorMatch(key) || httpStatusCodeToColor(key) || unassignedColors[key]; -} diff --git a/x-pack/plugins/apm/public/selectors/latency_chart_selector.test.ts b/x-pack/plugins/apm/public/selectors/latency_chart_selector.test.ts new file mode 100644 index 0000000000000..e474b5f0b8289 --- /dev/null +++ b/x-pack/plugins/apm/public/selectors/latency_chart_selector.test.ts @@ -0,0 +1,128 @@ +/* + * 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 { EuiTheme } from '../../../xpack_legacy/common'; +import { + getLatencyChartSelector, + LatencyChartsResponse, +} from './latency_chart_selectors'; + +const theme = { + eui: { + euiColorVis1: 'blue', + euiColorVis5: 'red', + euiColorVis7: 'black', + euiColorVis9: 'yellow', + }, +} as EuiTheme; + +const latencyChartData = { + overallAvgDuration: 1, + latency: { + avg: [{ x: 1, y: 10 }], + p95: [{ x: 2, y: 5 }], + p99: [{ x: 3, y: 8 }], + }, + anomalyTimeseries: { + jobId: '1', + anomalyBoundaries: [{ x: 1, y: 2 }], + anomalyScore: [{ x: 1, x0: 2 }], + }, +} as LatencyChartsResponse; + +describe('getLatencyChartSelector', () => { + describe('without anomaly', () => { + it('returns default values when data is undefined', () => { + const latencyChart = getLatencyChartSelector({ theme }); + expect(latencyChart).toEqual({ + latencyTimeseries: [], + mlJobId: undefined, + anomalyTimeseries: undefined, + }); + }); + it('returns latency time series', () => { + const { anomalyTimeseries, ...latencyWithouAnomaly } = latencyChartData; + const latencyTimeseries = getLatencyChartSelector({ + latencyChart: latencyWithouAnomaly as LatencyChartsResponse, + theme, + }); + expect(latencyTimeseries).toEqual({ + latencyTimeseries: [ + { + title: 'Avg.', + data: [{ x: 1, y: 10 }], + legendValue: '1 μs', + type: 'linemark', + color: 'blue', + }, + { + title: '95th percentile', + titleShort: '95th', + data: [{ x: 2, y: 5 }], + type: 'linemark', + color: 'red', + }, + { + title: '99th percentile', + titleShort: '99th', + data: [{ x: 3, y: 8 }], + type: 'linemark', + color: 'black', + }, + ], + }); + }); + }); + + describe('with anomaly', () => { + it('returns latency time series and anomaly timeseries', () => { + const latencyTimeseries = getLatencyChartSelector({ + latencyChart: latencyChartData, + theme, + }); + expect(latencyTimeseries).toEqual({ + latencyTimeseries: [ + { + title: 'Avg.', + data: [{ x: 1, y: 10 }], + legendValue: '1 μs', + type: 'linemark', + color: 'blue', + }, + { + title: '95th percentile', + titleShort: '95th', + data: [{ x: 2, y: 5 }], + type: 'linemark', + color: 'red', + }, + { + title: '99th percentile', + titleShort: '99th', + data: [{ x: 3, y: 8 }], + type: 'linemark', + color: 'black', + }, + ], + mlJobId: '1', + anomalyTimeseries: { + bounderies: { + title: 'Anomaly Boundaries', + data: [{ x: 1, y: 2 }], + type: 'area', + color: 'rgba(0,0,255,0.5)', + }, + scores: { + title: 'Anomaly score', + data: [{ x: 1, x0: 2 }], + type: 'rectAnnotation', + color: 'yellow', + }, + }, + }); + }); + }); +}); diff --git a/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts b/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts new file mode 100644 index 0000000000000..9b5dcc7e07893 --- /dev/null +++ b/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts @@ -0,0 +1,145 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { rgba } from 'polished'; +import { EuiTheme } from '../../../observability/public'; +import { asDuration } from '../../common/utils/formatters'; +import { + Coordinate, + RectCoordinate, + TimeSeries, +} from '../../typings/timeseries'; +import { APIReturnType } from '../services/rest/createCallApmApi'; + +export type LatencyChartsResponse = APIReturnType<'GET /api/apm/services/{serviceName}/transactions/charts/latency'>; + +interface LatencyChart { + latencyTimeseries: TimeSeries[]; + mlJobId?: string; + anomalyTimeseries?: { + bounderies: TimeSeries; + scores: TimeSeries; + }; +} + +export function getLatencyChartSelector({ + latencyChart, + theme, +}: { + latencyChart?: LatencyChartsResponse; + theme: EuiTheme; +}): LatencyChart { + if (!latencyChart) { + return { + latencyTimeseries: [], + mlJobId: undefined, + anomalyTimeseries: undefined, + }; + } + return { + latencyTimeseries: getLatencyTimeseries({ latencyChart, theme }), + mlJobId: latencyChart.anomalyTimeseries?.jobId, + anomalyTimeseries: getAnnomalyTimeseries({ + anomalyTimeseries: latencyChart.anomalyTimeseries, + theme, + }), + }; +} + +function getLatencyTimeseries({ + latencyChart, + theme, +}: { + latencyChart: LatencyChartsResponse; + theme: EuiTheme; +}) { + const { overallAvgDuration } = latencyChart; + const { avg, p95, p99 } = latencyChart.latency; + + const series = [ + { + title: i18n.translate( + 'xpack.apm.transactions.latency.chart.averageLabel', + { + defaultMessage: 'Avg.', + } + ), + data: avg, + legendValue: asDuration(overallAvgDuration), + type: 'linemark', + color: theme.eui.euiColorVis1, + }, + { + title: i18n.translate( + 'xpack.apm.transactions.latency.chart.95thPercentileLabel', + { + defaultMessage: '95th percentile', + } + ), + titleShort: '95th', + data: p95, + type: 'linemark', + color: theme.eui.euiColorVis5, + }, + { + title: i18n.translate( + 'xpack.apm.transactions.latency.chart.99thPercentileLabel', + { + defaultMessage: '99th percentile', + } + ), + titleShort: '99th', + data: p99, + type: 'linemark', + color: theme.eui.euiColorVis7, + }, + ]; + + return series; +} + +function getAnnomalyTimeseries({ + anomalyTimeseries, + theme, +}: { + anomalyTimeseries: LatencyChartsResponse['anomalyTimeseries']; + theme: EuiTheme; +}) { + if (anomalyTimeseries) { + return { + bounderies: getAnomalyBoundariesSeries( + anomalyTimeseries.anomalyBoundaries, + theme + ), + scores: getAnomalyScoreSeries(anomalyTimeseries.anomalyScore, theme), + }; + } +} + +export function getAnomalyScoreSeries(data: RectCoordinate[], theme: EuiTheme) { + return { + title: i18n.translate('xpack.apm.transactions.chart.anomalyScoreLabel', { + defaultMessage: 'Anomaly score', + }), + data, + type: 'rectAnnotation', + color: theme.eui.euiColorVis9, + }; +} + +function getAnomalyBoundariesSeries(data: Coordinate[], theme: EuiTheme) { + return { + title: i18n.translate( + 'xpack.apm.transactions.chart.anomalyBoundariesLabel', + { + defaultMessage: 'Anomaly Boundaries', + } + ), + data, + type: 'area', + color: rgba(theme.eui.euiColorVis1, 0.5), + }; +} diff --git a/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.test.ts b/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.test.ts new file mode 100644 index 0000000000000..0a04224d65501 --- /dev/null +++ b/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.test.ts @@ -0,0 +1,72 @@ +/* + * 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 { EuiTheme } from '../../../observability/public'; +import { + getThrouputChartSelector, + ThrouputChartsResponse, +} from './throuput_chart_selectors'; + +const theme = { + eui: { + euiColorVis1: 'green', + euiColorVis2: 'black', + euiColorVis3: 'gray', + euiColorVis4: 'blue', + euiColorVis6: 'red', + euiColorVis8: 'yellow', + euiColorSecondary: 'white', + euiColorDanger: 'purple', + }, +} as EuiTheme; + +const throughputData = { + throughput: [ + { key: 'HTTP 2xx', avg: 1, dataPoints: [{ x: 1, y: 2 }] }, + { key: 'HTTP 4xx', avg: 1, dataPoints: [{ x: 1, y: 2 }] }, + { key: 'HTTP 5xx', avg: 1, dataPoints: [{ x: 1, y: 2 }] }, + ], +} as ThrouputChartsResponse; + +describe('getThrouputChartSelector', () => { + it('returns default values when data is undefined', () => { + const throughputTimeseries = getThrouputChartSelector({ theme }); + expect(throughputTimeseries).toEqual({ throughputTimeseries: [] }); + }); + + it('return throughput time series', () => { + const throughputTimeseries = getThrouputChartSelector({ + theme, + throuputChart: throughputData, + }); + + expect(throughputTimeseries).toEqual({ + throughputTimeseries: [ + { + title: 'HTTP 2xx', + data: [{ x: 1, y: 2 }], + legendValue: '1.0 tpm', + type: 'linemark', + color: '#327a42', + }, + { + title: 'HTTP 4xx', + data: [{ x: 1, y: 2 }], + legendValue: '1.0 tpm', + type: 'linemark', + color: '#f5a700', + }, + { + title: 'HTTP 5xx', + data: [{ x: 1, y: 2 }], + legendValue: '1.0 tpm', + type: 'linemark', + color: '#c23c2b', + }, + ], + }); + }); +}); diff --git a/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.ts b/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.ts new file mode 100644 index 0000000000000..2ba9f2bcac67f --- /dev/null +++ b/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.ts @@ -0,0 +1,90 @@ +/* + * 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 { difference, zipObject } from 'lodash'; +import { EuiTheme } from '../../../observability/public'; +import { asTransactionRate } from '../../common/utils/formatters'; +import { TimeSeries } from '../../typings/timeseries'; +import { getEmptySeries } from '../components/shared/charts/helper/get_empty_series'; +import { APIReturnType } from '../services/rest/createCallApmApi'; +import { httpStatusCodeToColor } from '../utils/httpStatusCodeToColor'; + +export type ThrouputChartsResponse = APIReturnType<'GET /api/apm/services/{serviceName}/transactions/charts/throughput'>; + +interface ThroughputChart { + throughputTimeseries: TimeSeries[]; +} + +export function getThrouputChartSelector({ + theme, + throuputChart, +}: { + theme: EuiTheme; + throuputChart?: ThrouputChartsResponse; +}): ThroughputChart { + if (!throuputChart) { + return { throughputTimeseries: [] }; + } + + return { + throughputTimeseries: getThroughputTimeseries({ throuputChart, theme }), + }; +} + +export function getThroughputTimeseries({ + throuputChart, + theme, +}: { + theme: EuiTheme; + throuputChart: ThrouputChartsResponse; +}) { + const bucketKeys = throuputChart.throughput.map(({ key }) => key); + const getColor = getColorByKey(bucketKeys, theme); + + const { throughput } = throuputChart; + if (!throughput.length) { + const start = throughput[0].dataPoints[0].x; + const end = throughput[0].dataPoints[throughput[0].dataPoints.length - 1].x; + return getEmptySeries(start, end); + } + + return throughput.map((bucket) => { + return { + title: bucket.key, + data: bucket.dataPoints, + legendValue: asTransactionRate(bucket.avg), + type: 'linemark', + color: getColor(bucket.key), + }; + }); +} + +function colorMatch(key: string, theme: EuiTheme) { + if (/ok|success/i.test(key)) { + return theme.eui.euiColorSecondary; + } else if (/error|fail/i.test(key)) { + return theme.eui.euiColorDanger; + } +} + +function getColorByKey(keys: string[], theme: EuiTheme) { + const assignedColors = ['HTTP 2xx', 'HTTP 3xx', 'HTTP 4xx', 'HTTP 5xx']; + + const unknownKeys = difference(keys, assignedColors); + const unassignedColors: Record = zipObject(unknownKeys, [ + theme.eui.euiColorVis1, + theme.eui.euiColorVis3, + theme.eui.euiColorVis4, + theme.eui.euiColorVis6, + theme.eui.euiColorVis2, + theme.eui.euiColorVis8, + ]); + + return (key: string) => + colorMatch(key, theme) || + httpStatusCodeToColor(key) || + unassignedColors[key]; +} diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts index 6319f219ecee9..f63b6c0a2e77c 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts @@ -20,7 +20,9 @@ import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; import { Setup, SetupTimeRange } from '../../../lib/helpers/setup_request'; import { convertLatencyBucketsToCoordinates } from './transform'; -export type LatencyChartsResponse = PromiseReturnType; +export type LatencyChartsSearchResponse = PromiseReturnType< + typeof searchLatency +>; async function searchLatency({ serviceName, @@ -120,7 +122,7 @@ export async function getLatencyCharts({ if (!response.aggregations) { return { - latency: null, + latency: { avg: [], p95: [], p99: [] }, overallAvgDuration: null, }; } diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/mock_response/timeseries_response.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/mock_response/timeseries_response.ts index 0f65ac66c5ff5..1c948f334e751 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/mock_response/timeseries_response.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/mock_response/timeseries_response.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { LatencyChartsResponse } from '..'; +import { LatencyChartsSearchResponse } from '..'; export const timeseriesResponse = ({ took: 34, @@ -158,4 +158,4 @@ export const timeseriesResponse = ({ value: 4241957.611111111, }, }, -} as unknown) as LatencyChartsResponse; +} as unknown) as LatencyChartsSearchResponse; diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts index 9971fb289a1cb..2a35698920b9a 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts @@ -5,10 +5,10 @@ */ import { isNumber } from 'lodash'; -import { LatencyChartsResponse } from '.'; +import { LatencyChartsSearchResponse } from '.'; import { Coordinate } from '../../../../typings/timeseries'; -type LatencyBuckets = Required['aggregations']['latency']['buckets']; +type LatencyBuckets = Required['aggregations']['latency']['buckets']; export function convertLatencyBucketsToCoordinates( latencyBuckets: LatencyBuckets = [] diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts index cb289a091601e..1763c7a807f91 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts @@ -122,13 +122,9 @@ export async function getThroughputCharts({ intervalString, }); - if (!response.aggregations) { - return { throughput: [] }; - } - return { throughput: getThroughputBuckets({ - throughputResultBuckets: response.aggregations.throughput.buckets, + throughputResultBuckets: response.aggregations?.throughput.buckets, bucketSize, durationAsMinutes, }), diff --git a/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts b/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts index 8d0ae0f80be8a..02dc8bf569d11 100644 --- a/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts +++ b/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts @@ -109,59 +109,6 @@ export const transactionGroupsOverviewRoute = createRoute({ }, }); -// // /** -// // * Returns timeseries for latency, throughput and anomalies -// // * TODO: break it into 3 new APIs: -// // * - Latency: /transactions/charts/latency -// // * - Throughput: /transactions/charts/throughput -// // * - anomalies: /transactions/charts/anomaly -// // */ -// export const transactionChartsRoute = createRoute({ -// endpoint: 'GET /api/apm/services/{serviceName}/transactions/charts', -// params: t.type({ -// path: t.type({ -// serviceName: t.string, -// }), -// query: t.intersection([ -// t.partial({ -// transactionType: t.string, -// transactionName: t.string, -// }), -// uiFiltersRt, -// rangeRt, -// ]), -// }), -// options: { tags: ['access:apm'] }, -// handler: async ({ context, request }) => { -// const setup = await setupRequest(context, request); -// const logger = context.logger; -// const { serviceName } = context.params.path; -// const { transactionType, transactionName } = context.params.query; - -// if (!setup.uiFilters.environment) { -// throw Boom.badRequest( -// `environment is a required property of the ?uiFilters JSON for transaction_groups/charts.` -// ); -// } - -// const searchAggregatedTransactions = await getSearchAggregatedTransactions( -// setup -// ); - -// const options = { -// serviceName, -// transactionType, -// transactionName, -// setup, -// searchAggregatedTransactions, -// logger, -// }; - -// return getTransactionCharts(options); -// }, -// }); - - export const transactionLatencyChatsRoute = createRoute({ endpoint: 'GET /api/apm/services/{serviceName}/transactions/charts/latency', params: t.type({ @@ -202,20 +149,23 @@ export const transactionLatencyChatsRoute = createRoute({ searchAggregatedTransactions, }; - const {latency, overallAvgDuration} = await getLatencyCharts(options); + const { latency, overallAvgDuration } = await getLatencyCharts(options); - const anomalyTimeseries = latency ? await getAnomalySeries({ - ...options, - logger, - timeSeriesDates: latency.avg.map(({x}) => x), - }) : null + const anomalyTimeseries = latency + ? await getAnomalySeries({ + ...options, + logger, + timeSeriesDates: latency.avg.map(({ x }) => x), + }) + : null; - return {latency, overallAvgDuration, anomalyTimeseries} + return { latency, overallAvgDuration, anomalyTimeseries }; }, }); export const transactionThroughputChatsRoute = createRoute({ - endpoint: 'GET /api/apm/services/{serviceName}/transactions/charts/throughput', + endpoint: + 'GET /api/apm/services/{serviceName}/transactions/charts/throughput', params: t.type({ path: t.type({ serviceName: t.string, From a6f4e28740478e3db9ecaf9b98a062b0c2fd633f Mon Sep 17 00:00:00 2001 From: cauemarcondes Date: Tue, 8 Dec 2020 11:24:20 +0100 Subject: [PATCH 04/10] fixing i18n --- x-pack/plugins/translations/translations/ja-JP.json | 3 --- x-pack/plugins/translations/translations/zh-CN.json | 3 --- 2 files changed, 6 deletions(-) diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 9df495717b431..7c45c2850a648 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -5218,11 +5218,8 @@ "xpack.apm.transactionDurationLabel": "期間", "xpack.apm.transactionErrorRateAlert.name": "トランザクションエラー率しきい値", "xpack.apm.transactionErrorRateAlertTrigger.isAbove": "より大きい", - "xpack.apm.transactions.chart.95thPercentileLabel": "95 パーセンタイル", - "xpack.apm.transactions.chart.99thPercentileLabel": "99 パーセンタイル", "xpack.apm.transactions.chart.anomalyBoundariesLabel": "異常境界", "xpack.apm.transactions.chart.anomalyScoreLabel": "異常スコア", - "xpack.apm.transactions.chart.averageLabel": "平均", "xpack.apm.transactionsTable.95thPercentileColumnLabel": "95 パーセンタイル", "xpack.apm.transactionsTable.avgDurationColumnLabel": "平均期間", "xpack.apm.transactionsTable.impactColumnDescription": "ご利用のサービスで最も頻繁に使用されていて、最も遅いエンドポイントです。相対的平均時間に 1 分ごとのトランザクション数をかけて計算されます。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index fc70ada752a94..57d01db819e09 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -5222,11 +5222,8 @@ "xpack.apm.transactionDurationLabel": "持续时间", "xpack.apm.transactionErrorRateAlert.name": "事务错误率阈值", "xpack.apm.transactionErrorRateAlertTrigger.isAbove": "高于", - "xpack.apm.transactions.chart.95thPercentileLabel": "第 95 个百分位", - "xpack.apm.transactions.chart.99thPercentileLabel": "第 99 个百分位", "xpack.apm.transactions.chart.anomalyBoundariesLabel": "异常边界", "xpack.apm.transactions.chart.anomalyScoreLabel": "异常分数", - "xpack.apm.transactions.chart.averageLabel": "平均", "xpack.apm.transactionsTable.95thPercentileColumnLabel": "第 95 个百分位", "xpack.apm.transactionsTable.avgDurationColumnLabel": "平均持续时间", "xpack.apm.transactionsTable.impactColumnDescription": "服务中最常用的和最慢的终端节点。其计算方法是相对平均持续时间乘以每分钟事务数。", From 292d57be9d344c549d06e33334b63af6e59712a7 Mon Sep 17 00:00:00 2001 From: cauemarcondes Date: Tue, 8 Dec 2020 13:25:23 +0100 Subject: [PATCH 05/10] addressing pr comments --- .../transactions/{charts => }/get_anomaly_data/fetcher.ts | 6 +++--- .../{charts => }/get_anomaly_data/get_ml_bucket_size.ts | 2 +- .../transactions/{charts => }/get_anomaly_data/index.ts | 8 ++++---- .../{charts => }/get_anomaly_data/transform.ts | 2 +- .../transactions/get_latency_charts/index.ts | 0 .../mock_response/timeseries_response.ts | 0 .../transactions/get_latency_charts/transform.test.ts | 0 .../transactions/get_latency_charts/transform.ts | 0 .../transactions/get_throughput_charts/index.ts | 0 .../mock_response/timeseries_response.ts | 0 .../transactions/get_throughput_charts/transform.test.ts | 0 .../transactions/get_throughput_charts/transform.ts | 0 .../apm/server/routes/transactions/transactions_routes.ts | 6 +++--- 13 files changed, 12 insertions(+), 12 deletions(-) rename x-pack/plugins/apm/server/lib/transactions/{charts => }/get_anomaly_data/fetcher.ts (91%) rename x-pack/plugins/apm/server/lib/transactions/{charts => }/get_anomaly_data/get_ml_bucket_size.ts (94%) rename x-pack/plugins/apm/server/lib/transactions/{charts => }/get_anomaly_data/index.ts (89%) rename x-pack/plugins/apm/server/lib/transactions/{charts => }/get_anomaly_data/transform.ts (97%) rename x-pack/plugins/apm/server/{routes => lib}/transactions/get_latency_charts/index.ts (100%) rename x-pack/plugins/apm/server/{routes => lib}/transactions/get_latency_charts/mock_response/timeseries_response.ts (100%) rename x-pack/plugins/apm/server/{routes => lib}/transactions/get_latency_charts/transform.test.ts (100%) rename x-pack/plugins/apm/server/{routes => lib}/transactions/get_latency_charts/transform.ts (100%) rename x-pack/plugins/apm/server/{routes => lib}/transactions/get_throughput_charts/index.ts (100%) rename x-pack/plugins/apm/server/{routes => lib}/transactions/get_throughput_charts/mock_response/timeseries_response.ts (100%) rename x-pack/plugins/apm/server/{routes => lib}/transactions/get_throughput_charts/transform.test.ts (100%) rename x-pack/plugins/apm/server/{routes => lib}/transactions/get_throughput_charts/transform.ts (100%) diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts b/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/fetcher.ts similarity index 91% rename from x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts rename to x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/fetcher.ts index aad67c43f48e2..425250fd5a1d1 100644 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/fetcher.ts +++ b/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/fetcher.ts @@ -5,9 +5,9 @@ */ import { Logger } from 'kibana/server'; -import { ESSearchResponse } from '../../../../../../../typings/elasticsearch'; -import { PromiseReturnType } from '../../../../../../observability/typings/common'; -import { Setup, SetupTimeRange } from '../../../helpers/setup_request'; +import { ESSearchResponse } from '../../../../../../typings/elasticsearch'; +import { PromiseReturnType } from '../../../../../observability/typings/common'; +import { Setup, SetupTimeRange } from '../../helpers/setup_request'; export type ESResponse = Exclude< PromiseReturnType, diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/get_ml_bucket_size.ts b/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/get_ml_bucket_size.ts similarity index 94% rename from x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/get_ml_bucket_size.ts rename to x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/get_ml_bucket_size.ts index 8ab5b33003b86..1bb9e8a9e77a9 100644 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/get_ml_bucket_size.ts +++ b/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/get_ml_bucket_size.ts @@ -5,7 +5,7 @@ */ import { Logger } from 'kibana/server'; -import { Setup, SetupTimeRange } from '../../../helpers/setup_request'; +import { Setup, SetupTimeRange } from '../../helpers/setup_request'; interface IOptions { setup: Setup & SetupTimeRange; diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/index.ts b/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/index.ts similarity index 89% rename from x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/index.ts rename to x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/index.ts index e72219a3cbd72..9466a38e1bc00 100644 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/index.ts +++ b/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/index.ts @@ -5,13 +5,13 @@ */ import { Logger } from 'kibana/server'; import { isNumber } from 'lodash'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; -import { getBucketSize } from '../../../helpers/get_bucket_size'; -import { Setup, SetupTimeRange } from '../../../helpers/setup_request'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; +import { getBucketSize } from '../../helpers/get_bucket_size'; +import { Setup, SetupTimeRange } from '../../helpers/setup_request'; import { anomalySeriesFetcher } from './fetcher'; import { getMlBucketSize } from './get_ml_bucket_size'; import { anomalySeriesTransform } from './transform'; -import { getMLJobIds } from '../../../service_map/get_service_anomalies'; +import { getMLJobIds } from '../../service_map/get_service_anomalies'; export async function getAnomalySeries({ serviceName, diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.ts b/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/transform.ts similarity index 97% rename from x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.ts rename to x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/transform.ts index b971a1c28397d..3bc9fdbabf9b8 100644 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_anomaly_data/transform.ts +++ b/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/transform.ts @@ -5,7 +5,7 @@ */ import { first, last } from 'lodash'; -import { Coordinate, RectCoordinate } from '../../../../../typings/timeseries'; +import { Coordinate, RectCoordinate } from '../../../../typings/timeseries'; import { ESResponse } from './fetcher'; type IBucket = ReturnType; diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts b/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/index.ts similarity index 100% rename from x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts rename to x-pack/plugins/apm/server/lib/transactions/get_latency_charts/index.ts diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/mock_response/timeseries_response.ts b/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/mock_response/timeseries_response.ts similarity index 100% rename from x-pack/plugins/apm/server/routes/transactions/get_latency_charts/mock_response/timeseries_response.ts rename to x-pack/plugins/apm/server/lib/transactions/get_latency_charts/mock_response/timeseries_response.ts diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.test.ts b/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.test.ts similarity index 100% rename from x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.test.ts rename to x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.test.ts diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts b/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.ts similarity index 100% rename from x-pack/plugins/apm/server/routes/transactions/get_latency_charts/transform.ts rename to x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.ts diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts b/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/index.ts similarity index 100% rename from x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/index.ts rename to x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/index.ts diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/mock_response/timeseries_response.ts b/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/mock_response/timeseries_response.ts similarity index 100% rename from x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/mock_response/timeseries_response.ts rename to x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/mock_response/timeseries_response.ts diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.test.ts b/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/transform.test.ts similarity index 100% rename from x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.test.ts rename to x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/transform.test.ts diff --git a/x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.ts b/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/transform.ts similarity index 100% rename from x-pack/plugins/apm/server/routes/transactions/get_throughput_charts/transform.ts rename to x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/transform.ts diff --git a/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts b/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts index 02dc8bf569d11..8deffc4384d7f 100644 --- a/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts +++ b/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts @@ -11,14 +11,14 @@ import { getSearchAggregatedTransactions } from '../../lib/helpers/aggregated_tr import { setupRequest } from '../../lib/helpers/setup_request'; import { getServiceTransactionGroups } from '../../lib/services/get_service_transaction_groups'; import { getTransactionBreakdown } from '../../lib/transactions/breakdown'; -import { getAnomalySeries } from '../../lib/transactions/charts/get_anomaly_data'; +import { getAnomalySeries } from '../../lib/transactions/get_anomaly_data'; import { getTransactionDistribution } from '../../lib/transactions/distribution'; import { getTransactionGroupList } from '../../lib/transaction_groups'; import { getErrorRate } from '../../lib/transaction_groups/get_error_rate'; import { createRoute } from '../create_route'; import { rangeRt, uiFiltersRt } from '../default_api_types'; -import { getLatencyCharts } from './get_latency_charts'; -import { getThroughputCharts } from './get_throughput_charts'; +import { getLatencyCharts } from '../../lib/transactions/get_latency_charts'; +import { getThroughputCharts } from '../../lib/transactions/get_throughput_charts'; /** * Returns a list of transactions grouped by name From cec2f84816d377867228ddce4a3787ff61856ef3 Mon Sep 17 00:00:00 2001 From: cauemarcondes Date: Tue, 8 Dec 2020 14:01:40 +0100 Subject: [PATCH 06/10] fix api test --- .../basic/tests/feature_controls.ts | 27 +- .../apm_api_integration/basic/tests/index.ts | 3 +- .../{transaction_charts.ts => latency.ts} | 36 +- .../basic/tests/transactions/throughput.ts | 55 + .../csm/__snapshots__/page_load_dist.snap | 824 +++++++ .../tests/csm/__snapshots__/page_views.snap | 280 +++ .../apm_api_integration/trial/tests/index.ts | 2 +- .../__snapshots__/service_maps.snap | 1995 +++++++++++++++++ .../transactions/__snapshots__/latency.snap | 43 + .../{transactions_charts.ts => latency.ts} | 18 +- 10 files changed, 3245 insertions(+), 38 deletions(-) rename x-pack/test/apm_api_integration/basic/tests/transactions/{transaction_charts.ts => latency.ts} (50%) create mode 100644 x-pack/test/apm_api_integration/basic/tests/transactions/throughput.ts create mode 100644 x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_load_dist.snap create mode 100644 x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_views.snap create mode 100644 x-pack/test/apm_api_integration/trial/tests/service_maps/__snapshots__/service_maps.snap create mode 100644 x-pack/test/apm_api_integration/trial/tests/transactions/__snapshots__/latency.snap rename x-pack/test/apm_api_integration/trial/tests/transactions/{transactions_charts.ts => latency.ts} (89%) diff --git a/x-pack/test/apm_api_integration/basic/tests/feature_controls.ts b/x-pack/test/apm_api_integration/basic/tests/feature_controls.ts index 03ef521215219..29c081a6fe493 100644 --- a/x-pack/test/apm_api_integration/basic/tests/feature_controls.ts +++ b/x-pack/test/apm_api_integration/basic/tests/feature_controls.ts @@ -107,21 +107,42 @@ export default function featureControlsTests({ getService }: FtrProviderContext) }, { req: { - url: `/api/apm/services/foo/transactions/charts?start=${start}&end=${end}&transactionType=bar&uiFilters=%7B%22environment%22%3A%22testing%22%7D`, + url: `/api/apm/services/foo/transactions/charts/latency?start=${start}&end=${end}&transactionType=bar&uiFilters=%7B%22environment%22%3A%22testing%22%7D`, }, expectForbidden: expect403, expectResponse: expect200, }, { req: { - url: `/api/apm/services/foo/transactions/charts?start=${start}&end=${end}&uiFilters=%7B%22environment%22%3A%22testing%22%7D`, + url: `/api/apm/services/foo/transactions/charts/latency?start=${start}&end=${end}&uiFilters=%7B%22environment%22%3A%22testing%22%7D`, }, expectForbidden: expect403, expectResponse: expect200, }, { req: { - url: `/api/apm/services/foo/transactions/charts?start=${start}&end=${end}&transactionType=bar&transactionName=baz&uiFilters=%7B%22environment%22%3A%22testing%22%7D`, + url: `/api/apm/services/foo/transactions/charts/latency?start=${start}&end=${end}&transactionType=bar&transactionName=baz&uiFilters=%7B%22environment%22%3A%22testing%22%7D`, + }, + expectForbidden: expect403, + expectResponse: expect200, + }, + { + req: { + url: `/api/apm/services/foo/transactions/charts/throughput?start=${start}&end=${end}&transactionType=bar&uiFilters=%7B%22environment%22%3A%22testing%22%7D`, + }, + expectForbidden: expect403, + expectResponse: expect200, + }, + { + req: { + url: `/api/apm/services/foo/transactions/charts/throughput?start=${start}&end=${end}&uiFilters=%7B%22environment%22%3A%22testing%22%7D`, + }, + expectForbidden: expect403, + expectResponse: expect200, + }, + { + req: { + url: `/api/apm/services/foo/transactions/charts/throughput?start=${start}&end=${end}&transactionType=bar&transactionName=baz&uiFilters=%7B%22environment%22%3A%22testing%22%7D`, }, expectForbidden: expect403, expectResponse: expect200, diff --git a/x-pack/test/apm_api_integration/basic/tests/index.ts b/x-pack/test/apm_api_integration/basic/tests/index.ts index f6ee79382dd07..49ebea4d3303d 100644 --- a/x-pack/test/apm_api_integration/basic/tests/index.ts +++ b/x-pack/test/apm_api_integration/basic/tests/index.ts @@ -45,7 +45,8 @@ export default function apmApiIntegrationTests({ loadTestFile }: FtrProviderCont describe('Transactions', function () { loadTestFile(require.resolve('./transactions/top_transaction_groups')); - loadTestFile(require.resolve('./transactions/transaction_charts')); + loadTestFile(require.resolve('./transactions/latency')); + loadTestFile(require.resolve('./transactions/throughput')); loadTestFile(require.resolve('./transactions/error_rate')); loadTestFile(require.resolve('./transactions/breakdown')); loadTestFile(require.resolve('./transactions/distribution')); diff --git a/x-pack/test/apm_api_integration/basic/tests/transactions/transaction_charts.ts b/x-pack/test/apm_api_integration/basic/tests/transactions/latency.ts similarity index 50% rename from x-pack/test/apm_api_integration/basic/tests/transactions/transaction_charts.ts rename to x-pack/test/apm_api_integration/basic/tests/transactions/latency.ts index 711036d8df99d..d5f28adfc57a6 100644 --- a/x-pack/test/apm_api_integration/basic/tests/transactions/transaction_charts.ts +++ b/x-pack/test/apm_api_integration/basic/tests/transactions/latency.ts @@ -20,20 +20,19 @@ export default function ApiTest({ getService }: FtrProviderContext) { const end = encodeURIComponent(metadata.end); const uiFilters = encodeURIComponent(JSON.stringify({ environment: 'testing' })); - describe('Transaction charts', () => { + describe('Latency', () => { describe('when data is not loaded ', () => { it('handles the empty state', async () => { const response = await supertest.get( - `/api/apm/services/opbeans-node/transactions/charts?start=${start}&end=${end}&uiFilters=${uiFilters}` + `/api/apm/services/opbeans-node/transactions/charts/latency?start=${start}&end=${end}&uiFilters=${uiFilters}` ); expect(response.status).to.be(200); - expect(response.body.apmTimeseries.overallAvgDuration).to.be(null); - expect(response.body.apmTimeseries.responseTimes.avg.length).to.be(0); - expect(response.body.apmTimeseries.responseTimes.p95.length).to.be(0); - expect(response.body.apmTimeseries.responseTimes.p99.length).to.be(0); - expect(response.body.apmTimeseries.tpmBuckets.length).to.be(0); + expect(response.body.overallAvgDuration).to.be(null); + expect(response.body.latency.avg.length).to.be(0); + expect(response.body.latency.p95.length).to.be(0); + expect(response.body.latency.p99.length).to.be(0); }); }); @@ -45,28 +44,17 @@ export default function ApiTest({ getService }: FtrProviderContext) { before(async () => { response = await supertest.get( - `/api/apm/services/opbeans-node/transactions/charts?start=${start}&end=${end}&uiFilters=${uiFilters}` + `/api/apm/services/opbeans-node/transactions/charts/latency?start=${start}&end=${end}&uiFilters=${uiFilters}` ); }); - it('returns some data', async () => { + it('returns average duration and timeseries', async () => { expect(response.status).to.be(200); - expect(response.body.apmTimeseries.overallAvgDuration).not.to.be(null); - expect(response.body.apmTimeseries.responseTimes.avg.length).to.be.greaterThan(0); - expect(response.body.apmTimeseries.responseTimes.p95.length).to.be.greaterThan(0); - expect(response.body.apmTimeseries.responseTimes.p99.length).to.be.greaterThan(0); - expect(response.body.apmTimeseries.tpmBuckets.length).to.be.greaterThan(0); - }); - - it('returns the correct data', () => { - expectSnapshot(response.body.apmTimeseries.overallAvgDuration).toMatchInline( - `600888.274678112` - ); - expectSnapshot(response.body.apmTimeseries.responseTimes.avg.length).toMatchInline(`61`); - expectSnapshot(response.body.apmTimeseries.tpmBuckets.length).toMatchInline(`3`); - - expectSnapshot(response.body).toMatch(); + expect(response.body.overallAvgDuration).not.to.be(null); + expect(response.body.latency.avg.length).to.be.greaterThan(0); + expect(response.body.latency.p95.length).to.be.greaterThan(0); + expect(response.body.latency.p99.length).to.be.greaterThan(0); }); }); }); diff --git a/x-pack/test/apm_api_integration/basic/tests/transactions/throughput.ts b/x-pack/test/apm_api_integration/basic/tests/transactions/throughput.ts new file mode 100644 index 0000000000000..c8b36edbcbcb5 --- /dev/null +++ b/x-pack/test/apm_api_integration/basic/tests/transactions/throughput.ts @@ -0,0 +1,55 @@ +/* + * 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 expect from '@kbn/expect'; +import archives_metadata from '../../../common/archives_metadata'; +import { PromiseReturnType } from '../../../../../plugins/observability/typings/common'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; + +export default function ApiTest({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + + const archiveName = 'apm_8.0.0'; + const metadata = archives_metadata[archiveName]; + + // url parameters + const start = encodeURIComponent(metadata.start); + const end = encodeURIComponent(metadata.end); + const uiFilters = encodeURIComponent(JSON.stringify({ environment: 'testing' })); + + describe('Throughput', () => { + describe('when data is not loaded ', () => { + it('handles the empty state', async () => { + const response = await supertest.get( + `/api/apm/services/opbeans-node/transactions/charts/throughput?start=${start}&end=${end}&uiFilters=${uiFilters}` + ); + + expect(response.status).to.be(200); + + expect(response.body.throughput.length).to.be(0); + }); + }); + + describe('when data is loaded', () => { + before(() => esArchiver.load(archiveName)); + after(() => esArchiver.unload(archiveName)); + + let response: PromiseReturnType; + + before(async () => { + response = await supertest.get( + `/api/apm/services/opbeans-node/transactions/charts/throughput?start=${start}&end=${end}&uiFilters=${uiFilters}` + ); + }); + + it('returns throughput timeseries', async () => { + expect(response.status).to.be(200); + + expect(response.body.throughput.length).to.be.greaterThan(0); + }); + }); + }); +} diff --git a/x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_load_dist.snap b/x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_load_dist.snap new file mode 100644 index 0000000000000..4bf242d8f9b6d --- /dev/null +++ b/x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_load_dist.snap @@ -0,0 +1,824 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`UX page load dist when there is data returns page load distribution 1`] = ` +Object { + "maxDuration": 54.46, + "minDuration": 0, + "pageLoadDistribution": Array [ + Object { + "x": 0, + "y": 0, + }, + Object { + "x": 0.5, + "y": 0, + }, + Object { + "x": 1, + "y": 0, + }, + Object { + "x": 1.5, + "y": 0, + }, + Object { + "x": 2, + "y": 0, + }, + Object { + "x": 2.5, + "y": 0, + }, + Object { + "x": 3, + "y": 16.6666666666667, + }, + Object { + "x": 3.5, + "y": 0, + }, + Object { + "x": 4, + "y": 0, + }, + Object { + "x": 4.5, + "y": 0, + }, + Object { + "x": 5, + "y": 50, + }, + Object { + "x": 5.5, + "y": 0, + }, + Object { + "x": 6, + "y": 0, + }, + Object { + "x": 6.5, + "y": 0, + }, + Object { + "x": 7, + "y": 0, + }, + Object { + "x": 7.5, + "y": 0, + }, + Object { + "x": 8, + "y": 0, + }, + Object { + "x": 8.5, + "y": 0, + }, + Object { + "x": 9, + "y": 0, + }, + Object { + "x": 9.5, + "y": 0, + }, + Object { + "x": 10, + "y": 0, + }, + Object { + "x": 10.5, + "y": 0, + }, + Object { + "x": 11, + "y": 0, + }, + Object { + "x": 11.5, + "y": 0, + }, + Object { + "x": 12, + "y": 0, + }, + Object { + "x": 12.5, + "y": 0, + }, + Object { + "x": 13, + "y": 0, + }, + Object { + "x": 13.5, + "y": 0, + }, + Object { + "x": 14, + "y": 0, + }, + Object { + "x": 14.5, + "y": 0, + }, + Object { + "x": 15, + "y": 0, + }, + Object { + "x": 15.5, + "y": 0, + }, + Object { + "x": 16, + "y": 0, + }, + Object { + "x": 16.5, + "y": 0, + }, + Object { + "x": 17, + "y": 0, + }, + Object { + "x": 17.5, + "y": 0, + }, + Object { + "x": 18, + "y": 0, + }, + Object { + "x": 18.5, + "y": 0, + }, + Object { + "x": 19, + "y": 0, + }, + Object { + "x": 19.5, + "y": 0, + }, + Object { + "x": 20, + "y": 0, + }, + Object { + "x": 20.5, + "y": 0, + }, + Object { + "x": 21, + "y": 0, + }, + Object { + "x": 21.5, + "y": 0, + }, + Object { + "x": 22, + "y": 0, + }, + Object { + "x": 22.5, + "y": 0, + }, + Object { + "x": 23, + "y": 0, + }, + Object { + "x": 23.5, + "y": 0, + }, + Object { + "x": 24, + "y": 0, + }, + Object { + "x": 24.5, + "y": 0, + }, + Object { + "x": 25, + "y": 0, + }, + Object { + "x": 25.5, + "y": 0, + }, + Object { + "x": 26, + "y": 0, + }, + Object { + "x": 26.5, + "y": 0, + }, + Object { + "x": 27, + "y": 0, + }, + Object { + "x": 27.5, + "y": 0, + }, + Object { + "x": 28, + "y": 0, + }, + Object { + "x": 28.5, + "y": 0, + }, + Object { + "x": 29, + "y": 0, + }, + Object { + "x": 29.5, + "y": 0, + }, + Object { + "x": 30, + "y": 0, + }, + Object { + "x": 30.5, + "y": 0, + }, + Object { + "x": 31, + "y": 0, + }, + Object { + "x": 31.5, + "y": 0, + }, + Object { + "x": 32, + "y": 0, + }, + Object { + "x": 32.5, + "y": 0, + }, + Object { + "x": 33, + "y": 0, + }, + Object { + "x": 33.5, + "y": 0, + }, + Object { + "x": 34, + "y": 0, + }, + Object { + "x": 34.5, + "y": 0, + }, + Object { + "x": 35, + "y": 0, + }, + Object { + "x": 35.5, + "y": 0, + }, + Object { + "x": 36, + "y": 0, + }, + Object { + "x": 36.5, + "y": 0, + }, + Object { + "x": 37, + "y": 0, + }, + Object { + "x": 37.5, + "y": 16.6666666666667, + }, + Object { + "x": 38, + "y": 0, + }, + Object { + "x": 38.5, + "y": 0, + }, + Object { + "x": 39, + "y": 0, + }, + Object { + "x": 39.5, + "y": 0, + }, + Object { + "x": 40, + "y": 0, + }, + Object { + "x": 40.5, + "y": 0, + }, + Object { + "x": 41, + "y": 0, + }, + Object { + "x": 41.5, + "y": 0, + }, + Object { + "x": 42, + "y": 0, + }, + Object { + "x": 42.5, + "y": 0, + }, + Object { + "x": 43, + "y": 0, + }, + Object { + "x": 43.5, + "y": 0, + }, + Object { + "x": 44, + "y": 0, + }, + Object { + "x": 44.5, + "y": 0, + }, + Object { + "x": 45, + "y": 0, + }, + Object { + "x": 45.5, + "y": 0, + }, + Object { + "x": 46, + "y": 0, + }, + Object { + "x": 46.5, + "y": 0, + }, + Object { + "x": 47, + "y": 0, + }, + Object { + "x": 47.5, + "y": 0, + }, + Object { + "x": 48, + "y": 0, + }, + Object { + "x": 48.5, + "y": 0, + }, + Object { + "x": 49, + "y": 0, + }, + Object { + "x": 49.5, + "y": 0, + }, + Object { + "x": 50, + "y": 0, + }, + Object { + "x": 50.5, + "y": 0, + }, + Object { + "x": 51, + "y": 0, + }, + Object { + "x": 51.5, + "y": 0, + }, + Object { + "x": 52, + "y": 0, + }, + Object { + "x": 52.5, + "y": 0, + }, + Object { + "x": 53, + "y": 0, + }, + Object { + "x": 53.5, + "y": 0, + }, + Object { + "x": 54, + "y": 0, + }, + Object { + "x": 54.5, + "y": 16.6666666666667, + }, + ], + "percentiles": Object { + "50.0": 4.88, + "75.0": 37.09, + "90.0": 37.09, + "95.0": 54.46, + "99.0": 54.46, + }, +} +`; + +exports[`UX page load dist when there is data returns page load distribution with breakdown 1`] = ` +Array [ + Object { + "data": Array [ + Object { + "x": 0, + "y": 0, + }, + Object { + "x": 0.5, + "y": 0, + }, + Object { + "x": 1, + "y": 0, + }, + Object { + "x": 1.5, + "y": 0, + }, + Object { + "x": 2, + "y": 0, + }, + Object { + "x": 2.5, + "y": 0, + }, + Object { + "x": 3, + "y": 25, + }, + Object { + "x": 3.5, + "y": 0, + }, + Object { + "x": 4, + "y": 0, + }, + Object { + "x": 4.5, + "y": 0, + }, + Object { + "x": 5, + "y": 25, + }, + Object { + "x": 5.5, + "y": 0, + }, + Object { + "x": 6, + "y": 0, + }, + Object { + "x": 6.5, + "y": 0, + }, + Object { + "x": 7, + "y": 0, + }, + Object { + "x": 7.5, + "y": 0, + }, + Object { + "x": 8, + "y": 0, + }, + Object { + "x": 8.5, + "y": 0, + }, + Object { + "x": 9, + "y": 0, + }, + Object { + "x": 9.5, + "y": 0, + }, + Object { + "x": 10, + "y": 0, + }, + Object { + "x": 10.5, + "y": 0, + }, + Object { + "x": 11, + "y": 0, + }, + Object { + "x": 11.5, + "y": 0, + }, + Object { + "x": 12, + "y": 0, + }, + Object { + "x": 12.5, + "y": 0, + }, + Object { + "x": 13, + "y": 0, + }, + Object { + "x": 13.5, + "y": 0, + }, + Object { + "x": 14, + "y": 0, + }, + Object { + "x": 14.5, + "y": 0, + }, + Object { + "x": 15, + "y": 0, + }, + Object { + "x": 15.5, + "y": 0, + }, + Object { + "x": 16, + "y": 0, + }, + Object { + "x": 16.5, + "y": 0, + }, + Object { + "x": 17, + "y": 0, + }, + Object { + "x": 17.5, + "y": 0, + }, + Object { + "x": 18, + "y": 0, + }, + Object { + "x": 18.5, + "y": 0, + }, + Object { + "x": 19, + "y": 0, + }, + Object { + "x": 19.5, + "y": 0, + }, + Object { + "x": 20, + "y": 0, + }, + Object { + "x": 20.5, + "y": 0, + }, + Object { + "x": 21, + "y": 0, + }, + Object { + "x": 21.5, + "y": 0, + }, + Object { + "x": 22, + "y": 0, + }, + Object { + "x": 22.5, + "y": 0, + }, + Object { + "x": 23, + "y": 0, + }, + Object { + "x": 23.5, + "y": 0, + }, + Object { + "x": 24, + "y": 0, + }, + Object { + "x": 24.5, + "y": 0, + }, + Object { + "x": 25, + "y": 0, + }, + Object { + "x": 25.5, + "y": 0, + }, + Object { + "x": 26, + "y": 0, + }, + Object { + "x": 26.5, + "y": 0, + }, + Object { + "x": 27, + "y": 0, + }, + Object { + "x": 27.5, + "y": 0, + }, + Object { + "x": 28, + "y": 0, + }, + Object { + "x": 28.5, + "y": 0, + }, + Object { + "x": 29, + "y": 0, + }, + Object { + "x": 29.5, + "y": 0, + }, + Object { + "x": 30, + "y": 0, + }, + Object { + "x": 30.5, + "y": 0, + }, + Object { + "x": 31, + "y": 0, + }, + Object { + "x": 31.5, + "y": 0, + }, + Object { + "x": 32, + "y": 0, + }, + Object { + "x": 32.5, + "y": 0, + }, + Object { + "x": 33, + "y": 0, + }, + Object { + "x": 33.5, + "y": 0, + }, + Object { + "x": 34, + "y": 0, + }, + Object { + "x": 34.5, + "y": 0, + }, + Object { + "x": 35, + "y": 0, + }, + Object { + "x": 35.5, + "y": 0, + }, + Object { + "x": 36, + "y": 0, + }, + Object { + "x": 36.5, + "y": 0, + }, + Object { + "x": 37, + "y": 0, + }, + Object { + "x": 37.5, + "y": 25, + }, + ], + "name": "Chrome", + }, + Object { + "data": Array [ + Object { + "x": 0, + "y": 0, + }, + Object { + "x": 0.5, + "y": 0, + }, + Object { + "x": 1, + "y": 0, + }, + Object { + "x": 1.5, + "y": 0, + }, + Object { + "x": 2, + "y": 0, + }, + Object { + "x": 2.5, + "y": 0, + }, + Object { + "x": 3, + "y": 0, + }, + Object { + "x": 3.5, + "y": 0, + }, + Object { + "x": 4, + "y": 0, + }, + Object { + "x": 4.5, + "y": 0, + }, + Object { + "x": 5, + "y": 100, + }, + ], + "name": "Chrome Mobile", + }, +] +`; + +exports[`UX page load dist when there is no data returns empty list 1`] = `Object {}`; + +exports[`UX page load dist when there is no data returns empty list with breakdowns 1`] = `Object {}`; diff --git a/x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_views.snap b/x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_views.snap new file mode 100644 index 0000000000000..38b009fc73d34 --- /dev/null +++ b/x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_views.snap @@ -0,0 +1,280 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CSM page views when there is data returns page views 1`] = ` +Object { + "items": Array [ + Object { + "x": 1600149947000, + "y": 1, + }, + Object { + "x": 1600149957000, + "y": 0, + }, + Object { + "x": 1600149967000, + "y": 0, + }, + Object { + "x": 1600149977000, + "y": 0, + }, + Object { + "x": 1600149987000, + "y": 0, + }, + Object { + "x": 1600149997000, + "y": 0, + }, + Object { + "x": 1600150007000, + "y": 0, + }, + Object { + "x": 1600150017000, + "y": 0, + }, + Object { + "x": 1600150027000, + "y": 1, + }, + Object { + "x": 1600150037000, + "y": 0, + }, + Object { + "x": 1600150047000, + "y": 0, + }, + Object { + "x": 1600150057000, + "y": 0, + }, + Object { + "x": 1600150067000, + "y": 0, + }, + Object { + "x": 1600150077000, + "y": 1, + }, + Object { + "x": 1600150087000, + "y": 0, + }, + Object { + "x": 1600150097000, + "y": 0, + }, + Object { + "x": 1600150107000, + "y": 0, + }, + Object { + "x": 1600150117000, + "y": 0, + }, + Object { + "x": 1600150127000, + "y": 0, + }, + Object { + "x": 1600150137000, + "y": 0, + }, + Object { + "x": 1600150147000, + "y": 0, + }, + Object { + "x": 1600150157000, + "y": 0, + }, + Object { + "x": 1600150167000, + "y": 0, + }, + Object { + "x": 1600150177000, + "y": 1, + }, + Object { + "x": 1600150187000, + "y": 0, + }, + Object { + "x": 1600150197000, + "y": 0, + }, + Object { + "x": 1600150207000, + "y": 1, + }, + Object { + "x": 1600150217000, + "y": 0, + }, + Object { + "x": 1600150227000, + "y": 0, + }, + Object { + "x": 1600150237000, + "y": 1, + }, + ], + "topItems": Array [], +} +`; + +exports[`CSM page views when there is data returns page views with breakdown 1`] = ` +Object { + "items": Array [ + Object { + "Chrome": 1, + "x": 1600149947000, + "y": 1, + }, + Object { + "x": 1600149957000, + "y": 0, + }, + Object { + "x": 1600149967000, + "y": 0, + }, + Object { + "x": 1600149977000, + "y": 0, + }, + Object { + "x": 1600149987000, + "y": 0, + }, + Object { + "x": 1600149997000, + "y": 0, + }, + Object { + "x": 1600150007000, + "y": 0, + }, + Object { + "x": 1600150017000, + "y": 0, + }, + Object { + "Chrome": 1, + "x": 1600150027000, + "y": 1, + }, + Object { + "x": 1600150037000, + "y": 0, + }, + Object { + "x": 1600150047000, + "y": 0, + }, + Object { + "x": 1600150057000, + "y": 0, + }, + Object { + "x": 1600150067000, + "y": 0, + }, + Object { + "Chrome": 1, + "x": 1600150077000, + "y": 1, + }, + Object { + "x": 1600150087000, + "y": 0, + }, + Object { + "x": 1600150097000, + "y": 0, + }, + Object { + "x": 1600150107000, + "y": 0, + }, + Object { + "x": 1600150117000, + "y": 0, + }, + Object { + "x": 1600150127000, + "y": 0, + }, + Object { + "x": 1600150137000, + "y": 0, + }, + Object { + "x": 1600150147000, + "y": 0, + }, + Object { + "x": 1600150157000, + "y": 0, + }, + Object { + "x": 1600150167000, + "y": 0, + }, + Object { + "Chrome": 1, + "x": 1600150177000, + "y": 1, + }, + Object { + "x": 1600150187000, + "y": 0, + }, + Object { + "x": 1600150197000, + "y": 0, + }, + Object { + "Chrome Mobile": 1, + "x": 1600150207000, + "y": 1, + }, + Object { + "x": 1600150217000, + "y": 0, + }, + Object { + "x": 1600150227000, + "y": 0, + }, + Object { + "Chrome Mobile": 1, + "x": 1600150237000, + "y": 1, + }, + ], + "topItems": Array [ + "Chrome", + "Chrome Mobile", + ], +} +`; + +exports[`CSM page views when there is no data returns empty list 1`] = ` +Object { + "items": Array [], + "topItems": Array [], +} +`; + +exports[`CSM page views when there is no data returns empty list with breakdowns 1`] = ` +Object { + "items": Array [], + "topItems": Array [], +} +`; diff --git a/x-pack/test/apm_api_integration/trial/tests/index.ts b/x-pack/test/apm_api_integration/trial/tests/index.ts index 30974125dba7d..262b0f2b0daaf 100644 --- a/x-pack/test/apm_api_integration/trial/tests/index.ts +++ b/x-pack/test/apm_api_integration/trial/tests/index.ts @@ -16,7 +16,7 @@ export default function observabilityApiIntegrationTests({ loadTestFile }: FtrPr }); describe('Transactions', function () { - loadTestFile(require.resolve('./transactions/transactions_charts.ts')); + loadTestFile(require.resolve('./transactions/latency')); }); describe('Settings', function () { diff --git a/x-pack/test/apm_api_integration/trial/tests/service_maps/__snapshots__/service_maps.snap b/x-pack/test/apm_api_integration/trial/tests/service_maps/__snapshots__/service_maps.snap new file mode 100644 index 0000000000000..a7e6ae03b1bdc --- /dev/null +++ b/x-pack/test/apm_api_integration/trial/tests/service_maps/__snapshots__/service_maps.snap @@ -0,0 +1,1995 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Service Maps with a trial license /api/apm/service-map when there is data returns service map elements filtering by environment not defined 1`] = ` +Object { + "elements": Array [ + Object { + "data": Object { + "agent.name": "rum-js", + "id": "elastic-co-frontend", + "service.environment": "ENVIRONMENT_NOT_DEFINED", + "service.name": "elastic-co-frontend", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + }, + Object { + "data": Object { + "groupedConnections": Array [ + Object { + "id": ">a18132920325.cdn.optimizely.com:443", + "label": "a18132920325.cdn.optimizely.com:443", + "span.destination.service.resource": "a18132920325.cdn.optimizely.com:443", + "span.subtype": "iframe", + "span.type": "resource", + }, + Object { + "id": ">cdn.optimizely.com:443", + "label": "cdn.optimizely.com:443", + "span.destination.service.resource": "cdn.optimizely.com:443", + "span.subtype": "script", + "span.type": "resource", + }, + Object { + "id": ">fonts.googleapis.com:443", + "label": "fonts.googleapis.com:443", + "span.destination.service.resource": "fonts.googleapis.com:443", + "span.subtype": "link", + "span.type": "resource", + }, + Object { + "id": ">images.contentstack.io:443", + "label": "images.contentstack.io:443", + "span.destination.service.resource": "images.contentstack.io:443", + "span.subtype": "css", + "span.type": "resource", + }, + Object { + "id": ">info.elastic.co:443", + "label": "info.elastic.co:443", + "span.destination.service.resource": "info.elastic.co:443", + "span.subtype": "script", + "span.type": "resource", + }, + Object { + "id": ">p.typekit.net:443", + "label": "p.typekit.net:443", + "span.destination.service.resource": "p.typekit.net:443", + "span.subtype": "css", + "span.type": "resource", + }, + Object { + "id": ">static-www.elastic.co:443", + "label": "static-www.elastic.co:443", + "span.destination.service.resource": "static-www.elastic.co:443", + "span.subtype": "img", + "span.type": "resource", + }, + Object { + "id": ">use.typekit.net:443", + "label": "use.typekit.net:443", + "span.destination.service.resource": "use.typekit.net:443", + "span.subtype": "link", + "span.type": "resource", + }, + Object { + "id": ">www.elastic.co:443", + "label": "www.elastic.co:443", + "span.destination.service.resource": "www.elastic.co:443", + "span.subtype": "browser-timing", + "span.type": "hard-navigation", + }, + ], + "id": "resourceGroup{elastic-co-frontend}", + "label": "9 resources", + "span.type": "external", + }, + }, + Object { + "data": Object { + "id": "elastic-co-frontend~>resourceGroup{elastic-co-frontend}", + "source": "elastic-co-frontend", + "target": "resourceGroup{elastic-co-frontend}", + }, + }, + ], +} +`; + +exports[`Service Maps with a trial license /api/apm/service-map when there is data returns the correct data 3`] = ` +Array [ + Object { + "data": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + Object { + "data": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + Object { + "data": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + Object { + "data": Object { + "agent.name": "rum-js", + "id": "elastic-co-frontend", + "service.name": "elastic-co-frontend", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + }, + Object { + "data": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + }, + Object { + "data": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + Object { + "data": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + }, + Object { + "data": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + Object { + "data": Object { + "id": ">elasticsearch", + "label": "elasticsearch", + "span.destination.service.resource": "elasticsearch", + "span.subtype": "elasticsearch", + "span.type": "db", + }, + }, + Object { + "data": Object { + "id": ">redis", + "label": "redis", + "span.destination.service.resource": "redis", + "span.subtype": "redis", + "span.type": "db", + }, + }, + Object { + "data": Object { + "agent.name": "dotnet", + "id": "opbeans-dotnet", + "service.environment": null, + "service.name": "opbeans-dotnet", + }, + }, + Object { + "data": Object { + "groupedConnections": Array [ + Object { + "id": ">a18132920325.cdn.optimizely.com:443", + "label": "a18132920325.cdn.optimizely.com:443", + "span.destination.service.resource": "a18132920325.cdn.optimizely.com:443", + "span.subtype": "iframe", + "span.type": "resource", + }, + Object { + "id": ">cdn.optimizely.com:443", + "label": "cdn.optimizely.com:443", + "span.destination.service.resource": "cdn.optimizely.com:443", + "span.subtype": "script", + "span.type": "resource", + }, + Object { + "id": ">fonts.googleapis.com:443", + "label": "fonts.googleapis.com:443", + "span.destination.service.resource": "fonts.googleapis.com:443", + "span.subtype": "link", + "span.type": "resource", + }, + Object { + "id": ">images.contentstack.io:443", + "label": "images.contentstack.io:443", + "span.destination.service.resource": "images.contentstack.io:443", + "span.subtype": "css", + "span.type": "resource", + }, + Object { + "id": ">info.elastic.co:443", + "label": "info.elastic.co:443", + "span.destination.service.resource": "info.elastic.co:443", + "span.subtype": "script", + "span.type": "resource", + }, + Object { + "id": ">p.typekit.net:443", + "label": "p.typekit.net:443", + "span.destination.service.resource": "p.typekit.net:443", + "span.subtype": "css", + "span.type": "resource", + }, + Object { + "id": ">static-www.elastic.co:443", + "label": "static-www.elastic.co:443", + "span.destination.service.resource": "static-www.elastic.co:443", + "span.subtype": "img", + "span.type": "resource", + }, + Object { + "id": ">use.typekit.net:443", + "label": "use.typekit.net:443", + "span.destination.service.resource": "use.typekit.net:443", + "span.subtype": "link", + "span.type": "resource", + }, + Object { + "id": ">www.elastic.co:443", + "label": "www.elastic.co:443", + "span.destination.service.resource": "www.elastic.co:443", + "span.subtype": "browser-timing", + "span.type": "hard-navigation", + }, + ], + "id": "resourceGroup{elastic-co-frontend}", + "label": "9 resources", + "span.type": "external", + }, + }, + Object { + "data": Object { + "id": "opbeans-go~>postgresql", + "source": "opbeans-go", + "sourceData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + "target": ">postgresql", + "targetData": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-go~opbeans-node", + "source": "opbeans-go", + "sourceData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + "target": "opbeans-node", + "targetData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-go~opbeans-python", + "source": "opbeans-go", + "sourceData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + "target": "opbeans-python", + "targetData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-java~>postgresql", + "source": "opbeans-java", + "sourceData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": ">postgresql", + "targetData": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-java~opbeans-node", + "source": "opbeans-java", + "sourceData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-node", + "targetData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-java~opbeans-ruby", + "source": "opbeans-java", + "sourceData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-ruby", + "targetData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-node~>postgresql", + "source": "opbeans-node", + "sourceData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + "target": ">postgresql", + "targetData": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-node~opbeans-go", + "isInverseEdge": true, + "source": "opbeans-node", + "sourceData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + "target": "opbeans-go", + "targetData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-node~opbeans-java", + "isInverseEdge": true, + "source": "opbeans-node", + "sourceData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + "target": "opbeans-java", + "targetData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-node~opbeans-python", + "source": "opbeans-node", + "sourceData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + "target": "opbeans-python", + "targetData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-node~opbeans-ruby", + "source": "opbeans-node", + "sourceData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + "target": "opbeans-ruby", + "targetData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-python~>elasticsearch", + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": ">elasticsearch", + "targetData": Object { + "id": ">elasticsearch", + "label": "elasticsearch", + "span.destination.service.resource": "elasticsearch", + "span.subtype": "elasticsearch", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-python~>postgresql", + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": ">postgresql", + "targetData": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-python~>redis", + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": ">redis", + "targetData": Object { + "id": ">redis", + "label": "redis", + "span.destination.service.resource": "redis", + "span.subtype": "redis", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-python~opbeans-go", + "isInverseEdge": true, + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-go", + "targetData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-python~opbeans-node", + "isInverseEdge": true, + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-node", + "targetData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-python~opbeans-ruby", + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-ruby", + "targetData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-ruby~>postgresql", + "source": "opbeans-ruby", + "sourceData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": ">postgresql", + "targetData": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-ruby~opbeans-go", + "source": "opbeans-ruby", + "sourceData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-go", + "targetData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-ruby~opbeans-java", + "isInverseEdge": true, + "source": "opbeans-ruby", + "sourceData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-java", + "targetData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-ruby~opbeans-node", + "isInverseEdge": true, + "source": "opbeans-ruby", + "sourceData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-node", + "targetData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-ruby~opbeans-python", + "isInverseEdge": true, + "source": "opbeans-ruby", + "sourceData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-python", + "targetData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-rum~opbeans-go", + "source": "opbeans-rum", + "sourceData": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + "target": "opbeans-go", + "targetData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-rum~opbeans-java", + "source": "opbeans-rum", + "sourceData": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + "target": "opbeans-java", + "targetData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-rum~opbeans-node", + "source": "opbeans-rum", + "sourceData": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + "target": "opbeans-node", + "targetData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-rum~opbeans-python", + "source": "opbeans-rum", + "sourceData": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + "target": "opbeans-python", + "targetData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-rum~opbeans-ruby", + "source": "opbeans-rum", + "sourceData": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + "target": "opbeans-ruby", + "targetData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "elastic-co-frontend~>resourceGroup{elastic-co-frontend}", + "source": "elastic-co-frontend", + "target": "resourceGroup{elastic-co-frontend}", + }, + }, +] +`; + +exports[`Service Maps with a trial license when there is data with anomalies with the default apm user returns the correct anomaly stats 3`] = ` +Object { + "elements": Array [ + Object { + "data": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + Object { + "data": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + Object { + "data": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + Object { + "data": Object { + "agent.name": "rum-js", + "id": "elastic-co-frontend", + "service.name": "elastic-co-frontend", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + }, + Object { + "data": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + }, + Object { + "data": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + Object { + "data": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + }, + Object { + "data": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + Object { + "data": Object { + "id": ">elasticsearch", + "label": "elasticsearch", + "span.destination.service.resource": "elasticsearch", + "span.subtype": "elasticsearch", + "span.type": "db", + }, + }, + Object { + "data": Object { + "id": ">redis", + "label": "redis", + "span.destination.service.resource": "redis", + "span.subtype": "redis", + "span.type": "db", + }, + }, + Object { + "data": Object { + "agent.name": "dotnet", + "id": "opbeans-dotnet", + "service.environment": null, + "service.name": "opbeans-dotnet", + }, + }, + Object { + "data": Object { + "groupedConnections": Array [ + Object { + "id": ">a18132920325.cdn.optimizely.com:443", + "label": "a18132920325.cdn.optimizely.com:443", + "span.destination.service.resource": "a18132920325.cdn.optimizely.com:443", + "span.subtype": "iframe", + "span.type": "resource", + }, + Object { + "id": ">cdn.optimizely.com:443", + "label": "cdn.optimizely.com:443", + "span.destination.service.resource": "cdn.optimizely.com:443", + "span.subtype": "script", + "span.type": "resource", + }, + Object { + "id": ">fonts.googleapis.com:443", + "label": "fonts.googleapis.com:443", + "span.destination.service.resource": "fonts.googleapis.com:443", + "span.subtype": "link", + "span.type": "resource", + }, + Object { + "id": ">images.contentstack.io:443", + "label": "images.contentstack.io:443", + "span.destination.service.resource": "images.contentstack.io:443", + "span.subtype": "css", + "span.type": "resource", + }, + Object { + "id": ">info.elastic.co:443", + "label": "info.elastic.co:443", + "span.destination.service.resource": "info.elastic.co:443", + "span.subtype": "script", + "span.type": "resource", + }, + Object { + "id": ">p.typekit.net:443", + "label": "p.typekit.net:443", + "span.destination.service.resource": "p.typekit.net:443", + "span.subtype": "css", + "span.type": "resource", + }, + Object { + "id": ">static-www.elastic.co:443", + "label": "static-www.elastic.co:443", + "span.destination.service.resource": "static-www.elastic.co:443", + "span.subtype": "img", + "span.type": "resource", + }, + Object { + "id": ">use.typekit.net:443", + "label": "use.typekit.net:443", + "span.destination.service.resource": "use.typekit.net:443", + "span.subtype": "link", + "span.type": "resource", + }, + Object { + "id": ">www.elastic.co:443", + "label": "www.elastic.co:443", + "span.destination.service.resource": "www.elastic.co:443", + "span.subtype": "browser-timing", + "span.type": "hard-navigation", + }, + ], + "id": "resourceGroup{elastic-co-frontend}", + "label": "9 resources", + "span.type": "external", + }, + }, + Object { + "data": Object { + "id": "opbeans-go~>postgresql", + "source": "opbeans-go", + "sourceData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + "target": ">postgresql", + "targetData": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-go~opbeans-node", + "source": "opbeans-go", + "sourceData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + "target": "opbeans-node", + "targetData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-go~opbeans-python", + "source": "opbeans-go", + "sourceData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + "target": "opbeans-python", + "targetData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-java~>postgresql", + "source": "opbeans-java", + "sourceData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": ">postgresql", + "targetData": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-java~opbeans-node", + "source": "opbeans-java", + "sourceData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-node", + "targetData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-java~opbeans-ruby", + "source": "opbeans-java", + "sourceData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-ruby", + "targetData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-node~>postgresql", + "source": "opbeans-node", + "sourceData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + "target": ">postgresql", + "targetData": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-node~opbeans-go", + "isInverseEdge": true, + "source": "opbeans-node", + "sourceData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + "target": "opbeans-go", + "targetData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-node~opbeans-java", + "isInverseEdge": true, + "source": "opbeans-node", + "sourceData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + "target": "opbeans-java", + "targetData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-node~opbeans-python", + "source": "opbeans-node", + "sourceData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + "target": "opbeans-python", + "targetData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-node~opbeans-ruby", + "source": "opbeans-node", + "sourceData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + "target": "opbeans-ruby", + "targetData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-python~>elasticsearch", + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": ">elasticsearch", + "targetData": Object { + "id": ">elasticsearch", + "label": "elasticsearch", + "span.destination.service.resource": "elasticsearch", + "span.subtype": "elasticsearch", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-python~>postgresql", + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": ">postgresql", + "targetData": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-python~>redis", + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": ">redis", + "targetData": Object { + "id": ">redis", + "label": "redis", + "span.destination.service.resource": "redis", + "span.subtype": "redis", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-python~opbeans-go", + "isInverseEdge": true, + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-go", + "targetData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-python~opbeans-node", + "isInverseEdge": true, + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-node", + "targetData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + }, + Object { + "data": Object { + "bidirectional": true, + "id": "opbeans-python~opbeans-ruby", + "source": "opbeans-python", + "sourceData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-ruby", + "targetData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-ruby~>postgresql", + "source": "opbeans-ruby", + "sourceData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": ">postgresql", + "targetData": Object { + "id": ">postgresql", + "label": "postgresql", + "span.destination.service.resource": "postgresql", + "span.subtype": "postgresql", + "span.type": "db", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-ruby~opbeans-go", + "source": "opbeans-ruby", + "sourceData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-go", + "targetData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-ruby~opbeans-java", + "isInverseEdge": true, + "source": "opbeans-ruby", + "sourceData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-java", + "targetData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-ruby~opbeans-node", + "isInverseEdge": true, + "source": "opbeans-ruby", + "sourceData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-node", + "targetData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-ruby~opbeans-python", + "isInverseEdge": true, + "source": "opbeans-ruby", + "sourceData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + "target": "opbeans-python", + "targetData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-rum~opbeans-go", + "source": "opbeans-rum", + "sourceData": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + "target": "opbeans-go", + "targetData": Object { + "agent.name": "go", + "id": "opbeans-go", + "service.environment": "testing", + "service.name": "opbeans-go", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-rum~opbeans-java", + "source": "opbeans-rum", + "sourceData": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + "target": "opbeans-java", + "targetData": Object { + "agent.name": "java", + "id": "opbeans-java", + "service.environment": "production", + "service.name": "opbeans-java", + "serviceAnomalyStats": Object { + "actualValue": 559010.6, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-rum~opbeans-node", + "source": "opbeans-rum", + "sourceData": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + "target": "opbeans-node", + "targetData": Object { + "agent.name": "nodejs", + "id": "opbeans-node", + "service.environment": "testing", + "service.name": "opbeans-node", + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-rum~opbeans-python", + "source": "opbeans-rum", + "sourceData": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + "target": "opbeans-python", + "targetData": Object { + "agent.name": "python", + "id": "opbeans-python", + "service.environment": "production", + "service.name": "opbeans-python", + "serviceAnomalyStats": Object { + "actualValue": 47107.7692307692, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "opbeans-rum~opbeans-ruby", + "source": "opbeans-rum", + "sourceData": Object { + "agent.name": "rum-js", + "id": "opbeans-rum", + "service.environment": "testing", + "service.name": "opbeans-rum", + "serviceAnomalyStats": Object { + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-environment_not_defined-7ed6-high_mean_transaction_duration", + "transactionType": "page-load", + }, + }, + "target": "opbeans-ruby", + "targetData": Object { + "agent.name": "ruby", + "id": "opbeans-ruby", + "service.environment": "production", + "service.name": "opbeans-ruby", + "serviceAnomalyStats": Object { + "actualValue": 141536.936507937, + "anomalyScore": 0, + "healthStatus": "healthy", + "jobId": "apm-production-229a-high_mean_transaction_duration", + "transactionType": "request", + }, + }, + }, + }, + Object { + "data": Object { + "id": "elastic-co-frontend~>resourceGroup{elastic-co-frontend}", + "source": "elastic-co-frontend", + "target": "resourceGroup{elastic-co-frontend}", + }, + }, + ], +} +`; diff --git a/x-pack/test/apm_api_integration/trial/tests/transactions/__snapshots__/latency.snap b/x-pack/test/apm_api_integration/trial/tests/transactions/__snapshots__/latency.snap new file mode 100644 index 0000000000000..0ae6666fa89cc --- /dev/null +++ b/x-pack/test/apm_api_integration/trial/tests/transactions/__snapshots__/latency.snap @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Latency when data is loaded and fetching latency with uiFilters when not defined environments seleted should return the correct anomaly boundaries 1`] = `Array []`; + +exports[`Latency when data is loaded and fetching latency with uiFilters with environment selected and empty kuery filter should return a non-empty anomaly series 1`] = ` +Array [ + Object { + "x": 1601389800000, + "y": 1206111.33487531, + "y0": 10555.1290143587, + }, + Object { + "x": 1601390700000, + "y": 1223987.49321778, + "y0": 10177.4677901726, + }, + Object { + "x": 1601391600000, + "y": 1223987.49321778, + "y0": 10177.4677901726, + }, +] +`; + +exports[`Latency when data is loaded and fetching latency with uiFilters with environment selected in uiFilters should return a non-empty anomaly series 1`] = ` +Array [ + Object { + "x": 1601389800000, + "y": 1206111.33487531, + "y0": 10555.1290143587, + }, + Object { + "x": 1601390700000, + "y": 1223987.49321778, + "y0": 10177.4677901726, + }, + Object { + "x": 1601391600000, + "y": 1223987.49321778, + "y0": 10177.4677901726, + }, +] +`; diff --git a/x-pack/test/apm_api_integration/trial/tests/transactions/transactions_charts.ts b/x-pack/test/apm_api_integration/trial/tests/transactions/latency.ts similarity index 89% rename from x-pack/test/apm_api_integration/trial/tests/transactions/transactions_charts.ts rename to x-pack/test/apm_api_integration/trial/tests/transactions/latency.ts index 62dbf640a48c3..51584540097e8 100644 --- a/x-pack/test/apm_api_integration/trial/tests/transactions/transactions_charts.ts +++ b/x-pack/test/apm_api_integration/trial/tests/transactions/latency.ts @@ -22,12 +22,12 @@ export default function ApiTest({ getService }: FtrProviderContext) { const end = encodeURIComponent(range.end); const transactionType = 'request'; - describe('APM Transaction Overview', () => { + describe('Latency', () => { describe('when data is loaded', () => { before(() => esArchiver.load(archiveName)); after(() => esArchiver.unload(archiveName)); - describe('and fetching transaction charts with uiFilters', () => { + describe('and fetching latency with uiFilters', () => { const serviceName = 'opbeans-java'; let response: PromiseReturnType; @@ -35,7 +35,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { const uiFilters = encodeURIComponent(JSON.stringify({})); before(async () => { response = await supertest.get( - `/api/apm/services/${serviceName}/transactions/charts?start=${start}&end=${end}&transactionType=${transactionType}&uiFilters=${uiFilters}` + `/api/apm/services/${serviceName}/transactions/charts/latency?start=${start}&end=${end}&transactionType=${transactionType}&uiFilters=${uiFilters}` ); }); it('should return an error response', () => { @@ -46,7 +46,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { describe('without uiFilters', () => { before(async () => { response = await supertest.get( - `/api/apm/services/${serviceName}/transactions/charts?start=${start}&end=${end}&transactionType=${transactionType}` + `/api/apm/services/${serviceName}/transactions/charts/latency?start=${start}&end=${end}&transactionType=${transactionType}` ); }); it('should return an error response', () => { @@ -58,7 +58,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { const uiFilters = encodeURIComponent(JSON.stringify({ environment: 'production' })); before(async () => { response = await supertest.get( - `/api/apm/services/${serviceName}/transactions/charts?start=${start}&end=${end}&transactionType=${transactionType}&uiFilters=${uiFilters}` + `/api/apm/services/${serviceName}/transactions/charts/latency?start=${start}&end=${end}&transactionType=${transactionType}&uiFilters=${uiFilters}` ); }); @@ -81,13 +81,13 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); }); - describe('when not defined environments selected', () => { + describe('when not defined environments seleted', () => { const uiFilters = encodeURIComponent( JSON.stringify({ environment: 'ENVIRONMENT_NOT_DEFINED' }) ); before(async () => { response = await supertest.get( - `/api/apm/services/${serviceName}/transactions/charts?start=${start}&end=${end}&transactionType=${transactionType}&uiFilters=${uiFilters}` + `/api/apm/services/${serviceName}/transactions/charts/latency?start=${start}&end=${end}&transactionType=${transactionType}&uiFilters=${uiFilters}` ); }); @@ -113,7 +113,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { const uiFilters = encodeURIComponent(JSON.stringify({ environment: 'ENVIRONMENT_ALL' })); before(async () => { response = await supertest.get( - `/api/apm/services/${serviceName}/transactions/charts?start=${start}&end=${end}&transactionType=${transactionType}&uiFilters=${uiFilters}` + `/api/apm/services/${serviceName}/transactions/charts/latency?start=${start}&end=${end}&transactionType=${transactionType}&uiFilters=${uiFilters}` ); }); @@ -132,7 +132,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { ); before(async () => { response = await supertest.get( - `/api/apm/services/${serviceName}/transactions/charts?start=${start}&end=${end}&transactionType=${transactionType}&uiFilters=${uiFilters}` + `/api/apm/services/${serviceName}/transactions/charts/latency?start=${start}&end=${end}&transactionType=${transactionType}&uiFilters=${uiFilters}` ); }); From 345e261b2caa84070f1d0141e97f2d3ca91c5c91 Mon Sep 17 00:00:00 2001 From: cauemarcondes Date: Tue, 8 Dec 2020 14:13:48 +0100 Subject: [PATCH 07/10] refactoring some stuff --- .../apm/server/routes/create_apm_api.ts | 2 +- ...transactions_routes.ts => transactions.ts} | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) rename x-pack/plugins/apm/server/routes/{transactions/transactions_routes.ts => transactions.ts} (89%) diff --git a/x-pack/plugins/apm/server/routes/create_apm_api.ts b/x-pack/plugins/apm/server/routes/create_apm_api.ts index 7e2155cf3895d..458ab095dd946 100644 --- a/x-pack/plugins/apm/server/routes/create_apm_api.ts +++ b/x-pack/plugins/apm/server/routes/create_apm_api.ts @@ -58,7 +58,7 @@ import { transactionGroupsOverviewRoute, transactionLatencyChatsRoute, transactionThroughputChatsRoute, -} from './transactions/transactions_routes'; +} from './transactions'; import { errorGroupsLocalFiltersRoute, metricsLocalFiltersRoute, diff --git a/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts b/x-pack/plugins/apm/server/routes/transactions.ts similarity index 89% rename from x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts rename to x-pack/plugins/apm/server/routes/transactions.ts index 8deffc4384d7f..f6c4907c92f0b 100644 --- a/x-pack/plugins/apm/server/routes/transactions/transactions_routes.ts +++ b/x-pack/plugins/apm/server/routes/transactions.ts @@ -6,19 +6,19 @@ import Boom from '@hapi/boom'; import * as t from 'io-ts'; -import { toNumberRt } from '../../../common/runtime_types/to_number_rt'; -import { getSearchAggregatedTransactions } from '../../lib/helpers/aggregated_transactions'; -import { setupRequest } from '../../lib/helpers/setup_request'; -import { getServiceTransactionGroups } from '../../lib/services/get_service_transaction_groups'; -import { getTransactionBreakdown } from '../../lib/transactions/breakdown'; -import { getAnomalySeries } from '../../lib/transactions/get_anomaly_data'; -import { getTransactionDistribution } from '../../lib/transactions/distribution'; -import { getTransactionGroupList } from '../../lib/transaction_groups'; -import { getErrorRate } from '../../lib/transaction_groups/get_error_rate'; -import { createRoute } from '../create_route'; -import { rangeRt, uiFiltersRt } from '../default_api_types'; -import { getLatencyCharts } from '../../lib/transactions/get_latency_charts'; -import { getThroughputCharts } from '../../lib/transactions/get_throughput_charts'; +import { createRoute } from './create_route'; +import { rangeRt, uiFiltersRt } from './default_api_types'; +import { toNumberRt } from '../../common/runtime_types/to_number_rt'; +import { getSearchAggregatedTransactions } from '../lib/helpers/aggregated_transactions'; +import { setupRequest } from '../lib/helpers/setup_request'; +import { getServiceTransactionGroups } from '../lib/services/get_service_transaction_groups'; +import { getTransactionBreakdown } from '../lib/transactions/breakdown'; +import { getAnomalySeries } from '../lib/transactions/get_anomaly_data'; +import { getTransactionDistribution } from '../lib/transactions/distribution'; +import { getTransactionGroupList } from '../lib/transaction_groups'; +import { getErrorRate } from '../lib/transaction_groups/get_error_rate'; +import { getLatencyCharts } from '../lib/transactions/get_latency_charts'; +import { getThroughputCharts } from '../lib/transactions/get_throughput_charts'; /** * Returns a list of transactions grouped by name From f12bf0477cc87716f340562f62ef862bfe35eaa9 Mon Sep 17 00:00:00 2001 From: cauemarcondes Date: Wed, 9 Dec 2020 10:11:42 +0100 Subject: [PATCH 08/10] addressing pr comments --- .../selectors/latency_chart_selector.test.ts | 2 +- .../selectors/latency_chart_selectors.ts | 2 +- .../throuput_chart_selectors.test.ts | 2 +- .../selectors/throuput_chart_selectors.ts | 15 +- .../transactions/get_latency_charts/index.ts | 10 +- .../mock_response/timeseries_response.ts | 161 ------------ .../get_latency_charts/transform.test.ts | 56 ---- .../get_latency_charts/transform.ts | 2 +- .../get_throughput_charts/index.ts | 2 +- .../mock_response/timeseries_response.ts | 239 ------------------ .../get_throughput_charts/transform.test.ts | 125 --------- .../plugins/apm/server/routes/transactions.ts | 13 +- .../basic/tests/transactions/latency.ts | 12 +- .../basic/tests/transactions/throughput.ts | 4 +- 14 files changed, 35 insertions(+), 610 deletions(-) delete mode 100644 x-pack/plugins/apm/server/lib/transactions/get_latency_charts/mock_response/timeseries_response.ts delete mode 100644 x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.test.ts delete mode 100644 x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/mock_response/timeseries_response.ts delete mode 100644 x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/transform.test.ts diff --git a/x-pack/plugins/apm/public/selectors/latency_chart_selector.test.ts b/x-pack/plugins/apm/public/selectors/latency_chart_selector.test.ts index e474b5f0b8289..4684742bf4d8b 100644 --- a/x-pack/plugins/apm/public/selectors/latency_chart_selector.test.ts +++ b/x-pack/plugins/apm/public/selectors/latency_chart_selector.test.ts @@ -21,7 +21,7 @@ const theme = { const latencyChartData = { overallAvgDuration: 1, - latency: { + latencyTimeseries: { avg: [{ x: 1, y: 10 }], p95: [{ x: 2, y: 5 }], p99: [{ x: 3, y: 8 }], diff --git a/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts b/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts index 9b5dcc7e07893..73b855e12d96e 100644 --- a/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts +++ b/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts @@ -57,7 +57,7 @@ function getLatencyTimeseries({ theme: EuiTheme; }) { const { overallAvgDuration } = latencyChart; - const { avg, p95, p99 } = latencyChart.latency; + const { avg, p95, p99 } = latencyChart.latencyTimeseries; const series = [ { diff --git a/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.test.ts b/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.test.ts index 0a04224d65501..ac85142f3050b 100644 --- a/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.test.ts +++ b/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.test.ts @@ -24,7 +24,7 @@ const theme = { } as EuiTheme; const throughputData = { - throughput: [ + throughputTimeseries: [ { key: 'HTTP 2xx', avg: 1, dataPoints: [{ x: 1, y: 2 }] }, { key: 'HTTP 4xx', avg: 1, dataPoints: [{ x: 1, y: 2 }] }, { key: 'HTTP 5xx', avg: 1, dataPoints: [{ x: 1, y: 2 }] }, diff --git a/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.ts b/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.ts index 2ba9f2bcac67f..701558b154677 100644 --- a/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.ts +++ b/x-pack/plugins/apm/public/selectors/throuput_chart_selectors.ts @@ -41,17 +41,20 @@ export function getThroughputTimeseries({ theme: EuiTheme; throuputChart: ThrouputChartsResponse; }) { - const bucketKeys = throuputChart.throughput.map(({ key }) => key); + const { throughputTimeseries } = throuputChart; + const bucketKeys = throughputTimeseries.map(({ key }) => key); const getColor = getColorByKey(bucketKeys, theme); - const { throughput } = throuputChart; - if (!throughput.length) { - const start = throughput[0].dataPoints[0].x; - const end = throughput[0].dataPoints[throughput[0].dataPoints.length - 1].x; + if (!throughputTimeseries.length) { + const start = throughputTimeseries[0].dataPoints[0].x; + const end = + throughputTimeseries[0].dataPoints[ + throughputTimeseries[0].dataPoints.length - 1 + ].x; return getEmptySeries(start, end); } - return throughput.map((bucket) => { + return throughputTimeseries.map((bucket) => { return { title: bucket.key, data: bucket.dataPoints, diff --git a/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/index.ts b/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/index.ts index f63b6c0a2e77c..35e14fcc4624b 100644 --- a/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/index.ts +++ b/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/index.ts @@ -73,7 +73,7 @@ async function searchLatency({ size: 0, query: { bool: { filter } }, aggs: { - latency: { + latencyTimeseries: { date_histogram: { field: '@timestamp', fixed_interval: intervalString, @@ -99,7 +99,7 @@ async function searchLatency({ return apmEventClient.search(params); } -export async function getLatencyCharts({ +export async function getLatencyTimeseries({ serviceName, transactionType, transactionName, @@ -122,7 +122,7 @@ export async function getLatencyCharts({ if (!response.aggregations) { return { - latency: { avg: [], p95: [], p99: [] }, + latencyTimeseries: { avg: [], p95: [], p99: [] }, overallAvgDuration: null, }; } @@ -130,8 +130,8 @@ export async function getLatencyCharts({ return { overallAvgDuration: response.aggregations.overall_avg_duration.value || null, - latency: convertLatencyBucketsToCoordinates( - response.aggregations.latency.buckets + latencyTimeseries: convertLatencyBucketsToCoordinates( + response.aggregations.latencyTimeseries.buckets ), }; } diff --git a/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/mock_response/timeseries_response.ts b/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/mock_response/timeseries_response.ts deleted file mode 100644 index 1c948f334e751..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/mock_response/timeseries_response.ts +++ /dev/null @@ -1,161 +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 { LatencyChartsSearchResponse } from '..'; - -export const timeseriesResponse = ({ - took: 34, - timed_out: false, - _shards: { - total: 105, - successful: 105, - skipped: 101, - failed: 0, - }, - hits: { - total: { - value: 18, - relation: 'eq', - }, - max_score: null, - hits: [], - }, - aggregations: { - latency: { - buckets: [ - { - key_as_string: '2020-12-07T13:00:30.000Z', - key: 1607346030000, - doc_count: 1, - pct: { - values: { - '95.0': 13888.0, - '99.0': 13888.0, - }, - }, - avg: { - value: 13942.0, - }, - }, - { - key_as_string: '2020-12-07T13:01:00.000Z', - key: 1607346060000, - doc_count: 3, - pct: { - values: { - '95.0': 23552.0, - '99.0': 23552.0, - }, - }, - avg: { - value: 19322.333333333332, - }, - }, - { - key_as_string: '2020-12-07T13:01:30.000Z', - key: 1607346090000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-12-07T13:02:00.000Z', - key: 1607346120000, - doc_count: 8, - pct: { - values: { - '95.0': 378864.0, - '99.0': 378864.0, - }, - }, - avg: { - value: 68323.875, - }, - }, - { - key_as_string: '2020-12-07T13:02:30.000Z', - key: 1607346150000, - doc_count: 3, - pct: { - values: { - '95.0': 7.392448e7, - '99.0': 7.392448e7, - }, - }, - avg: { - value: 2.5222877333333332e7, - }, - }, - { - key_as_string: '2020-12-07T13:03:00.000Z', - key: 1607346180000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-12-07T13:03:30.000Z', - key: 1607346210000, - doc_count: 0, - pct: { - values: { - '95.0': null, - '99.0': null, - }, - }, - avg: { - value: null, - }, - }, - { - key_as_string: '2020-12-07T13:04:00.000Z', - key: 1607346240000, - doc_count: 2, - pct: { - values: { - '95.0': 38016.0, - '99.0': 38016.0, - }, - }, - avg: { - value: 29134.0, - }, - }, - { - key_as_string: '2020-12-07T13:04:30.000Z', - key: 1607346270000, - doc_count: 1, - pct: { - values: { - '95.0': 9792.0, - '99.0': 9792.0, - }, - }, - avg: { - value: 9837.0, - }, - }, - ], - }, - overall_avg_duration: { - value: 4241957.611111111, - }, - }, -} as unknown) as LatencyChartsSearchResponse; diff --git a/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.test.ts b/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.test.ts deleted file mode 100644 index a9ebc4d67a88d..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.test.ts +++ /dev/null @@ -1,56 +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 { timeseriesResponse } from './mock_response/timeseries_response'; -import { convertLatencyBucketsToCoordinates } from './transform'; - -describe('convertLatencyBucketsToCoordinates', () => { - it('returns default value when latency buckets is undefined', () => { - const latency = convertLatencyBucketsToCoordinates(); - expect(latency).toEqual({ avg: [], p95: [], p99: [] }); - }); - - it('returns latecy coordinates', () => { - const latency = convertLatencyBucketsToCoordinates( - timeseriesResponse.aggregations?.latency.buckets - ); - expect(latency).toEqual({ - avg: [ - { x: 1607346030000, y: 13942 }, - { x: 1607346060000, y: 19322.333333333332 }, - { x: 1607346090000, y: null }, - { x: 1607346120000, y: 68323.875 }, - { x: 1607346150000, y: 25222877.333333332 }, - { x: 1607346180000, y: null }, - { x: 1607346210000, y: null }, - { x: 1607346240000, y: 29134 }, - { x: 1607346270000, y: 9837 }, - ], - p95: [ - { x: 1607346030000, y: 13888 }, - { x: 1607346060000, y: 23552 }, - { x: 1607346090000, y: null }, - { x: 1607346120000, y: 378864 }, - { x: 1607346150000, y: 73924480 }, - { x: 1607346180000, y: null }, - { x: 1607346210000, y: null }, - { x: 1607346240000, y: 38016 }, - { x: 1607346270000, y: 9792 }, - ], - p99: [ - { x: 1607346030000, y: 13888 }, - { x: 1607346060000, y: 23552 }, - { x: 1607346090000, y: null }, - { x: 1607346120000, y: 378864 }, - { x: 1607346150000, y: 73924480 }, - { x: 1607346180000, y: null }, - { x: 1607346210000, y: null }, - { x: 1607346240000, y: 38016 }, - { x: 1607346270000, y: 9792 }, - ], - }); - }); -}); diff --git a/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.ts b/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.ts index 2a35698920b9a..f4d914afc9483 100644 --- a/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.ts +++ b/x-pack/plugins/apm/server/lib/transactions/get_latency_charts/transform.ts @@ -8,7 +8,7 @@ import { isNumber } from 'lodash'; import { LatencyChartsSearchResponse } from '.'; import { Coordinate } from '../../../../typings/timeseries'; -type LatencyBuckets = Required['aggregations']['latency']['buckets']; +type LatencyBuckets = Required['aggregations']['latencyTimeseries']['buckets']; export function convertLatencyBucketsToCoordinates( latencyBuckets: LatencyBuckets = [] diff --git a/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/index.ts b/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/index.ts index 1763c7a807f91..e7007f8db0197 100644 --- a/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/index.ts +++ b/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/index.ts @@ -123,7 +123,7 @@ export async function getThroughputCharts({ }); return { - throughput: getThroughputBuckets({ + throughputTimeseries: getThroughputBuckets({ throughputResultBuckets: response.aggregations?.throughput.buckets, bucketSize, durationAsMinutes, diff --git a/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/mock_response/timeseries_response.ts b/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/mock_response/timeseries_response.ts deleted file mode 100644 index dcbc4ad47a7b4..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/mock_response/timeseries_response.ts +++ /dev/null @@ -1,239 +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 { ThroughputChartsResponse } from '..'; - -export const timeseriesResponse = ({ - took: 43, - timed_out: false, - _shards: { - total: 105, - successful: 105, - skipped: 101, - failed: 0, - }, - hits: { - total: { - value: 16, - relation: 'eq', - }, - max_score: null, - hits: [], - }, - aggregations: { - throughput: { - doc_count_error_upper_bound: 0, - sum_other_doc_count: 0, - buckets: [ - { - key: 'A Custom Bucket (that should be last)', - doc_count: 0, - timeseries: { buckets: [] }, - }, - { - key: 'HTTP 2xx', - doc_count: 9, - timeseries: { - buckets: [ - { - key_as_string: '2020-12-07T13:02:00.000Z', - key: 1607346120000, - doc_count: 1, - count: { - value: 1, - }, - }, - { - key_as_string: '2020-12-07T13:02:30.000Z', - key: 1607346150000, - doc_count: 2, - count: { - value: 2, - }, - }, - { - key_as_string: '2020-12-07T13:03:00.000Z', - key: 1607346180000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-12-07T13:03:30.000Z', - key: 1607346210000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-12-07T13:04:00.000Z', - key: 1607346240000, - doc_count: 2, - count: { - value: 2, - }, - }, - { - key_as_string: '2020-12-07T13:04:30.000Z', - key: 1607346270000, - doc_count: 1, - count: { - value: 1, - }, - }, - { - key_as_string: '2020-12-07T13:05:00.000Z', - key: 1607346300000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-12-07T13:05:30.000Z', - key: 1607346330000, - doc_count: 1, - count: { - value: 1, - }, - }, - { - key_as_string: '2020-12-07T13:06:00.000Z', - key: 1607346360000, - doc_count: 2, - count: { - value: 2, - }, - }, - ], - }, - }, - { - key: 'HTTP 5xx', - doc_count: 5, - timeseries: { - buckets: [ - { - key_as_string: '2020-12-07T13:02:00.000Z', - key: 1607346120000, - doc_count: 3, - count: { - value: 3, - }, - }, - { - key_as_string: '2020-12-07T13:02:30.000Z', - key: 1607346150000, - doc_count: 1, - count: { - value: 1, - }, - }, - { - key_as_string: '2020-12-07T13:03:00.000Z', - key: 1607346180000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-12-07T13:03:30.000Z', - key: 1607346210000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-12-07T13:04:00.000Z', - key: 1607346240000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-12-07T13:04:30.000Z', - key: 1607346270000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-12-07T13:05:00.000Z', - key: 1607346300000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-12-07T13:05:30.000Z', - key: 1607346330000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-12-07T13:06:00.000Z', - key: 1607346360000, - doc_count: 0, - count: { - value: 0, - }, - }, - { - key_as_string: '2020-12-07T13:06:30.000Z', - key: 1607346390000, - doc_count: 1, - count: { - value: 1, - }, - }, - ], - }, - }, - { - key: 'HTTP 4xx', - doc_count: 2, - timeseries: { - buckets: [ - { - key_as_string: '2020-12-07T13:02:00.000Z', - key: 1607346120000, - doc_count: 2, - count: { - value: 2, - }, - }, - ], - }, - }, - { - key: 'HTTP 3xx', - doc_count: 2, - timeseries: { - buckets: [ - { - key_as_string: '2020-12-07T13:02:00.000Z', - key: 1607346120000, - doc_count: 2, - count: { - value: 2, - }, - }, - ], - }, - }, - ], - }, - }, -} as unknown) as ThroughputChartsResponse; diff --git a/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/transform.test.ts b/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/transform.test.ts deleted file mode 100644 index 8207e33b4ef99..0000000000000 --- a/x-pack/plugins/apm/server/lib/transactions/get_throughput_charts/transform.test.ts +++ /dev/null @@ -1,125 +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 { timeseriesResponse } from './mock_response/timeseries_response'; -import { getThroughputBuckets } from './transform'; - -describe('getThroughputBuckets', () => { - const bucketSize = 30; - const durationAsMinutes = 10; - - it('should have correct order', () => { - const throughput = getThroughputBuckets({ - throughputResultBuckets: - timeseriesResponse.aggregations?.throughput.buckets, - bucketSize, - durationAsMinutes, - }); - expect(throughput.map((bucket) => bucket.key)).toEqual([ - 'HTTP 2xx', - 'HTTP 3xx', - 'HTTP 4xx', - 'HTTP 5xx', - 'A Custom Bucket (that should be last)', - ]); - }); - - it('calculates the thoughput based bucket size and duration', () => { - const buckets = [ - { - key: 'HTTP 4xx', - doc_count: 300, - timeseries: { - buckets: [ - { - key_as_string: '', - key: 0, - doc_count: 0, - count: { value: 0 }, - }, - { - key_as_string: '', - key: 1, - doc_count: 200, - count: { value: 200 }, - }, - { - key_as_string: '', - key: 2, - doc_count: 300, - count: { value: 300 }, - }, - { - key_as_string: '', - key: 3, - doc_count: 400, - count: { value: 400 }, - }, - ], - }, - }, - { - key: 'HTTP 5xx', - doc_count: 400, - timeseries: { - buckets: [ - { - key_as_string: '', - key: 0, - doc_count: 0, - count: { value: 0 }, - }, - { - key_as_string: '', - key: 1, - doc_count: 100, - count: { value: 100 }, - }, - { - key_as_string: '', - key: 2, - doc_count: 100, - count: { value: 100 }, - }, - { - key_as_string: '', - key: 3, - doc_count: 300, - count: { value: 300 }, - }, - ], - }, - }, - ]; - const throuput = getThroughputBuckets({ - throughputResultBuckets: buckets, - bucketSize: 120, - durationAsMinutes: 10, - }); - expect(throuput).toEqual([ - { - avg: 90, - dataPoints: [ - { x: 0, y: 0 }, - { x: 1, y: 100 }, - { x: 2, y: 150 }, - { x: 3, y: 200 }, - ], - key: 'HTTP 4xx', - }, - { - avg: 50, - dataPoints: [ - { x: 0, y: 0 }, - { x: 1, y: 50 }, - { x: 2, y: 50 }, - { x: 3, y: 150 }, - ], - key: 'HTTP 5xx', - }, - ]); - }); -}); diff --git a/x-pack/plugins/apm/server/routes/transactions.ts b/x-pack/plugins/apm/server/routes/transactions.ts index f6c4907c92f0b..9666f7f62612f 100644 --- a/x-pack/plugins/apm/server/routes/transactions.ts +++ b/x-pack/plugins/apm/server/routes/transactions.ts @@ -17,7 +17,7 @@ import { getAnomalySeries } from '../lib/transactions/get_anomaly_data'; import { getTransactionDistribution } from '../lib/transactions/distribution'; import { getTransactionGroupList } from '../lib/transaction_groups'; import { getErrorRate } from '../lib/transaction_groups/get_error_rate'; -import { getLatencyCharts } from '../lib/transactions/get_latency_charts'; +import { getLatencyTimeseries } from '../lib/transactions/get_latency_charts'; import { getThroughputCharts } from '../lib/transactions/get_throughput_charts'; /** @@ -149,17 +149,20 @@ export const transactionLatencyChatsRoute = createRoute({ searchAggregatedTransactions, }; - const { latency, overallAvgDuration } = await getLatencyCharts(options); + const { + latencyTimeseries, + overallAvgDuration, + } = await getLatencyTimeseries(options); - const anomalyTimeseries = latency + const anomalyTimeseries = latencyTimeseries ? await getAnomalySeries({ ...options, logger, - timeSeriesDates: latency.avg.map(({ x }) => x), + timeSeriesDates: latencyTimeseries.avg.map(({ x }) => x), }) : null; - return { latency, overallAvgDuration, anomalyTimeseries }; + return { latencyTimeseries, overallAvgDuration, anomalyTimeseries }; }, }); diff --git a/x-pack/test/apm_api_integration/basic/tests/transactions/latency.ts b/x-pack/test/apm_api_integration/basic/tests/transactions/latency.ts index d5f28adfc57a6..d856483752ac3 100644 --- a/x-pack/test/apm_api_integration/basic/tests/transactions/latency.ts +++ b/x-pack/test/apm_api_integration/basic/tests/transactions/latency.ts @@ -30,9 +30,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(response.status).to.be(200); expect(response.body.overallAvgDuration).to.be(null); - expect(response.body.latency.avg.length).to.be(0); - expect(response.body.latency.p95.length).to.be(0); - expect(response.body.latency.p99.length).to.be(0); + expect(response.body.latencyTimeseries.avg.length).to.be(0); + expect(response.body.latencyTimeseries.p95.length).to.be(0); + expect(response.body.latencyTimeseries.p99.length).to.be(0); }); }); @@ -52,9 +52,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(response.status).to.be(200); expect(response.body.overallAvgDuration).not.to.be(null); - expect(response.body.latency.avg.length).to.be.greaterThan(0); - expect(response.body.latency.p95.length).to.be.greaterThan(0); - expect(response.body.latency.p99.length).to.be.greaterThan(0); + expect(response.body.latencyTimeseries.avg.length).to.be.greaterThan(0); + expect(response.body.latencyTimeseries.p95.length).to.be.greaterThan(0); + expect(response.body.latencyTimeseries.p99.length).to.be.greaterThan(0); }); }); }); diff --git a/x-pack/test/apm_api_integration/basic/tests/transactions/throughput.ts b/x-pack/test/apm_api_integration/basic/tests/transactions/throughput.ts index c8b36edbcbcb5..beec346eb8d51 100644 --- a/x-pack/test/apm_api_integration/basic/tests/transactions/throughput.ts +++ b/x-pack/test/apm_api_integration/basic/tests/transactions/throughput.ts @@ -29,7 +29,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(response.status).to.be(200); - expect(response.body.throughput.length).to.be(0); + expect(response.body.throughputTimeseries.length).to.be(0); }); }); @@ -48,7 +48,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { it('returns throughput timeseries', async () => { expect(response.status).to.be(200); - expect(response.body.throughput.length).to.be.greaterThan(0); + expect(response.body.throughputTimeseries.length).to.be.greaterThan(0); }); }); }); From 85efe7113d6e4798744f1cae1e67eab622976bde Mon Sep 17 00:00:00 2001 From: cauemarcondes Date: Wed, 9 Dec 2020 10:11:59 +0100 Subject: [PATCH 09/10] addressing pr comments --- .../transactions/get_anomaly_data/index.ts | 24 ++++++++++++------- .../plugins/apm/server/routes/transactions.ts | 12 ++++------ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/index.ts b/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/index.ts index 9466a38e1bc00..27dd7c0f6970b 100644 --- a/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/index.ts +++ b/x-pack/plugins/apm/server/lib/transactions/get_anomaly_data/index.ts @@ -12,29 +12,35 @@ import { anomalySeriesFetcher } from './fetcher'; import { getMlBucketSize } from './get_ml_bucket_size'; import { anomalySeriesTransform } from './transform'; import { getMLJobIds } from '../../service_map/get_service_anomalies'; +import { getLatencyTimeseries } from '../get_latency_charts'; +import { PromiseReturnType } from '../../../../../observability/typings/common'; export async function getAnomalySeries({ serviceName, transactionType, transactionName, - timeSeriesDates, + latencyTimeseries, setup, logger, }: { serviceName: string; transactionType: string | undefined; transactionName: string | undefined; - timeSeriesDates: number[]; + latencyTimeseries: PromiseReturnType< + typeof getLatencyTimeseries + >['latencyTimeseries']; setup: Setup & SetupTimeRange; logger: Logger; }) { - // don't fetch anomalies for transaction details page - if (transactionName) { - return; - } + const timeseriesDates = latencyTimeseries?.avg?.map(({ x }) => x); - // don't fetch anomalies without a type - if (!transactionType) { + /* + * don't fetch: + * - anomalies for transaction details page + * - anomalies without a type + * - timeseries is empty + */ + if (transactionName || !transactionType || !timeseriesDates?.length) { return; } @@ -94,7 +100,7 @@ export async function getAnomalySeries({ esResponse, mlBucketSize, bucketSize, - timeSeriesDates, + timeseriesDates, jobId ); } diff --git a/x-pack/plugins/apm/server/routes/transactions.ts b/x-pack/plugins/apm/server/routes/transactions.ts index 9666f7f62612f..9b7a0981a4fed 100644 --- a/x-pack/plugins/apm/server/routes/transactions.ts +++ b/x-pack/plugins/apm/server/routes/transactions.ts @@ -154,13 +154,11 @@ export const transactionLatencyChatsRoute = createRoute({ overallAvgDuration, } = await getLatencyTimeseries(options); - const anomalyTimeseries = latencyTimeseries - ? await getAnomalySeries({ - ...options, - logger, - timeSeriesDates: latencyTimeseries.avg.map(({ x }) => x), - }) - : null; + const anomalyTimeseries = await getAnomalySeries({ + ...options, + logger, + latencyTimeseries, + }); return { latencyTimeseries, overallAvgDuration, anomalyTimeseries }; }, From 04d8b0ac1fa3380f0164d2581d547fc021cb412b Mon Sep 17 00:00:00 2001 From: cauemarcondes Date: Wed, 9 Dec 2020 15:09:50 +0100 Subject: [PATCH 10/10] fixing test --- .../transactions/__snapshots__/latency.snap | 60 ++++++++++++------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/x-pack/test/apm_api_integration/trial/tests/transactions/__snapshots__/latency.snap b/x-pack/test/apm_api_integration/trial/tests/transactions/__snapshots__/latency.snap index 0ae6666fa89cc..1b7e2fbbc5a30 100644 --- a/x-pack/test/apm_api_integration/trial/tests/transactions/__snapshots__/latency.snap +++ b/x-pack/test/apm_api_integration/trial/tests/transactions/__snapshots__/latency.snap @@ -1,43 +1,61 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Latency when data is loaded and fetching latency with uiFilters when not defined environments seleted should return the correct anomaly boundaries 1`] = `Array []`; +exports[`Latency when data is loaded and fetching transaction charts with uiFilters when not defined environments seleted should return the correct anomaly boundaries 1`] = ` +Array [ + Object { + "x": 1607436000000, + "y": 0, + "y0": 0, + }, + Object { + "x": 1607436900000, + "y": 0, + "y0": 0, + }, + Object { + "x": 1607437650000, + "y": 0, + "y0": 0, + }, +] +`; -exports[`Latency when data is loaded and fetching latency with uiFilters with environment selected and empty kuery filter should return a non-empty anomaly series 1`] = ` +exports[`Latency when data is loaded and fetching transaction charts with uiFilters with environment selected and empty kuery filter should return a non-empty anomaly series 1`] = ` Array [ Object { - "x": 1601389800000, - "y": 1206111.33487531, - "y0": 10555.1290143587, + "x": 1607436000000, + "y": 1625128.56211579, + "y0": 7533.02707532227, }, Object { - "x": 1601390700000, - "y": 1223987.49321778, - "y0": 10177.4677901726, + "x": 1607436900000, + "y": 1660982.24115757, + "y0": 5732.00699123528, }, Object { - "x": 1601391600000, - "y": 1223987.49321778, - "y0": 10177.4677901726, + "x": 1607437650000, + "y": 1660982.24115757, + "y0": 5732.00699123528, }, ] `; -exports[`Latency when data is loaded and fetching latency with uiFilters with environment selected in uiFilters should return a non-empty anomaly series 1`] = ` +exports[`Latency when data is loaded and fetching transaction charts with uiFilters with environment selected in uiFilters should return a non-empty anomaly series 1`] = ` Array [ Object { - "x": 1601389800000, - "y": 1206111.33487531, - "y0": 10555.1290143587, + "x": 1607436000000, + "y": 1625128.56211579, + "y0": 7533.02707532227, }, Object { - "x": 1601390700000, - "y": 1223987.49321778, - "y0": 10177.4677901726, + "x": 1607436900000, + "y": 1660982.24115757, + "y0": 5732.00699123528, }, Object { - "x": 1601391600000, - "y": 1223987.49321778, - "y0": 10177.4677901726, + "x": 1607437650000, + "y": 1660982.24115757, + "y0": 5732.00699123528, }, ] `;