From a3020b453047680e39b2267dbff78beff553ba9b Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Tue, 22 Mar 2022 01:06:49 -0700 Subject: [PATCH] [Reporting] Correction to schema for jobType size metrics (#128205) * [Reporting] Correction to schema for jobType size metrics * fixes * fixes2 * fix snapshots --- .../reporting_usage_collector.test.ts.snap | 168 ++++--- .../server/usage/get_export_stats.test.ts | 24 +- .../server/usage/get_export_stats.ts | 4 +- .../server/usage/get_reporting_usage.ts | 13 +- .../reporting/server/usage/schema.test.ts | 168 +++---- .../plugins/reporting/server/usage/schema.ts | 2 +- .../plugins/reporting/server/usage/types.ts | 4 +- .../schema/xpack_plugins.json | 420 +++++++++--------- .../reporting_and_security/usage/metrics.ts | 2 +- 9 files changed, 402 insertions(+), 403 deletions(-) diff --git a/x-pack/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap b/x-pack/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap index 7cd86b60e3354..af04dd4659433 100644 --- a/x-pack/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap +++ b/x-pack/plugins/reporting/server/usage/__snapshots__/reporting_usage_collector.test.ts.snap @@ -56,7 +56,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -134,7 +134,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -204,7 +204,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -268,7 +268,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -350,7 +350,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -428,7 +428,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -495,7 +495,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -559,7 +559,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -685,7 +685,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -788,7 +788,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -1364,7 +1364,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -1467,7 +1467,7 @@ Object { }, }, }, - "sizes": Object { + "output_size": Object { "1.0": Object { "type": "long", }, @@ -1974,7 +1974,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2009,7 +2009,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2040,7 +2040,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2069,7 +2069,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2106,7 +2106,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2141,7 +2141,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2171,7 +2171,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2200,7 +2200,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2246,7 +2246,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2291,7 +2291,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2349,7 +2349,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2394,7 +2394,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2445,7 +2445,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2480,7 +2480,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2511,7 +2511,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2540,7 +2540,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2577,7 +2577,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2612,7 +2612,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2642,7 +2642,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2671,7 +2671,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2717,7 +2717,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2762,7 +2762,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2814,7 +2814,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2859,7 +2859,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2904,7 +2904,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2939,7 +2939,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2970,7 +2970,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -2999,7 +2999,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3036,7 +3036,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3071,7 +3071,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3101,7 +3101,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3130,7 +3130,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3176,7 +3176,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3221,7 +3221,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3238,15 +3238,7 @@ Object { }, "statuses": undefined, }, - "output_size": Object { - "1.0": 1156282, - "25.0": 1156282, - "5.0": 1156282, - "50.0": 1158078.5, - "75.0": 1159875, - "95.0": 1159875, - "99.0": 1159875, - }, + "output_size": undefined, "printable_pdf": Object { "app": Object { "canvas workpad": 0, @@ -3281,7 +3273,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3356,14 +3348,14 @@ Object { }, }, }, - "sizes": Object { - "1.0": 1156282, - "25.0": 1156282, - "5.0": 1156282, - "50.0": 1158078.5, - "75.0": 1159875, - "95.0": 1159875, - "99.0": 1159875, + "output_size": Object { + "1.0": null, + "25.0": null, + "5.0": null, + "50.0": null, + "75.0": null, + "95.0": null, + "99.0": null, }, "total": 3, }, @@ -3401,7 +3393,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3436,7 +3428,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3467,7 +3459,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3496,7 +3488,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3533,7 +3525,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3568,7 +3560,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3598,7 +3590,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3627,7 +3619,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3673,7 +3665,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3718,7 +3710,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3781,7 +3773,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3826,7 +3818,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3882,7 +3874,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3917,7 +3909,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3948,7 +3940,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -3977,7 +3969,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -4014,7 +4006,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -4049,7 +4041,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -4079,7 +4071,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -4108,7 +4100,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -4154,7 +4146,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -4199,7 +4191,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -4251,7 +4243,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, @@ -4296,7 +4288,7 @@ Object { "99.0": null, }, }, - "sizes": Object { + "output_size": Object { "1.0": null, "25.0": null, "5.0": null, diff --git a/x-pack/plugins/reporting/server/usage/get_export_stats.test.ts b/x-pack/plugins/reporting/server/usage/get_export_stats.test.ts index 26b83f007a5e8..b553e12e06558 100644 --- a/x-pack/plugins/reporting/server/usage/get_export_stats.test.ts +++ b/x-pack/plugins/reporting/server/usage/get_export_stats.test.ts @@ -79,14 +79,14 @@ test('Model of jobTypes', () => { PNG: { available: true, total: 3, - sizes: sizesAggResponse, + output_size: sizesAggResponse, app: { dashboard: 0, visualization: 3, 'canvas workpad': 0 }, metrics: { png_cpu: {}, png_memory: {} } as MetricsStats, }, printable_pdf: { available: true, total: 3, - sizes: sizesAggResponse, + output_size: sizesAggResponse, app: { dashboard: 0, visualization: 0, 'canvas workpad': 3 }, layout: { preserve_layout: 3, print: 0, canvas: 0 }, metrics: { pdf_cpu: {}, pdf_memory: {}, pdf_pages: {} } as MetricsStats, @@ -95,7 +95,7 @@ test('Model of jobTypes', () => { available: true, total: 3, app: { search: 3 }, - sizes: sizesAggResponse, + output_size: sizesAggResponse, metrics: { csv_rows: {} } as MetricsStats, }, }, @@ -118,7 +118,7 @@ test('Model of jobTypes', () => { "png_cpu": Object {}, "png_memory": Object {}, }, - "sizes": Object { + "output_size": Object { "1.0": 5093470, "25.0": 5093470, "5.0": 5093470, @@ -144,7 +144,7 @@ test('Model of jobTypes', () => { "metrics": Object { "csv_rows": Object {}, }, - "sizes": Object { + "output_size": Object { "1.0": 5093470, "25.0": 5093470, "5.0": 5093470, @@ -176,7 +176,7 @@ test('Model of jobTypes', () => { "pdf_memory": Object {}, "pdf_pages": Object {}, }, - "sizes": Object { + "output_size": Object { "1.0": 5093470, "25.0": 5093470, "5.0": 5093470, @@ -197,7 +197,7 @@ test('PNG counts, provided count of deprecated jobs explicitly', () => { available: true, total: 15, deprecated: 5, - sizes: sizesAggResponse, + output_size: sizesAggResponse, app: { dashboard: 0, visualization: 0, 'canvas workpad': 0 }, metrics: { png_cpu: {}, png_memory: {} } as MetricsStats, }, @@ -220,7 +220,7 @@ test('PNG counts, provided count of deprecated jobs explicitly', () => { "png_cpu": Object {}, "png_memory": Object {}, }, - "sizes": Object { + "output_size": Object { "1.0": 5093470, "25.0": 5093470, "5.0": 5093470, @@ -240,7 +240,7 @@ test('Incorporate metric stats', () => { PNGV2: { available: true, total: 3, - sizes: sizesAggResponse, + output_size: sizesAggResponse, app: { dashboard: 0, visualization: 0, 'canvas workpad': 3 }, metrics: { png_cpu: { '50.0': 0.01, '75.0': 0.01, '95.0': 0.01, '99.0': 0.01 }, @@ -250,7 +250,7 @@ test('Incorporate metric stats', () => { printable_pdf_v2: { available: true, total: 3, - sizes: sizesAggResponse, + output_size: sizesAggResponse, metrics: { pdf_cpu: { '50.0': 0.01, '75.0': 0.01, '95.0': 0.01, '99.0': 0.01 }, pdf_memory: { '50.0': 3485, '75.0': 3496, '95.0': 3678, '99.0': 3782 }, @@ -288,7 +288,7 @@ test('Incorporate metric stats', () => { "99.0": 3782, }, }, - "sizes": Object { + "output_size": Object { "1.0": 5093470, "25.0": 5093470, "5.0": 5093470, @@ -335,7 +335,7 @@ test('Incorporate metric stats', () => { "99.0": 4, }, }, - "sizes": Object { + "output_size": Object { "1.0": 5093470, "25.0": 5093470, "5.0": 5093470, diff --git a/x-pack/plugins/reporting/server/usage/get_export_stats.ts b/x-pack/plugins/reporting/server/usage/get_export_stats.ts index 223cff8962381..94c2d5ec66de0 100644 --- a/x-pack/plugins/reporting/server/usage/get_export_stats.ts +++ b/x-pack/plugins/reporting/server/usage/get_export_stats.ts @@ -23,7 +23,7 @@ const defaultTotalsForFeature: Omit & { layout: Lay total: 0, deprecated: 0, app: { 'canvas workpad': 0, search: 0, visualization: 0, dashboard: 0 }, - sizes: ['1.0', '5.0', '25.0', '50.0', '75.0', '95.0', '99.0'].reduce( + output_size: ['1.0', '5.0', '25.0', '50.0', '75.0', '95.0', '99.0'].reduce( (sps, p) => ({ ...sps, [p]: null }), {} as SizePercentiles ), @@ -79,7 +79,7 @@ function getAvailableTotalForFeature( available: isAvailable(featureAvailability, exportType), total: jobType?.total || 0, deprecated, - sizes: { ...defaultTotalsForFeature.sizes, ...jobType?.sizes }, + output_size: { ...defaultTotalsForFeature.output_size, ...jobType?.output_size }, metrics: { ...metricsForFeature[exportType], ...jobType?.metrics }, app: { ...defaultTotalsForFeature.app, ...jobType?.app }, layout: jobTypeIsPdf(exportType) diff --git a/x-pack/plugins/reporting/server/usage/get_reporting_usage.ts b/x-pack/plugins/reporting/server/usage/get_reporting_usage.ts index 369419abd2f1e..a0a01ec602d82 100644 --- a/x-pack/plugins/reporting/server/usage/get_reporting_usage.ts +++ b/x-pack/plugins/reporting/server/usage/get_reporting_usage.ts @@ -32,7 +32,7 @@ enum keys { OBJECT_TYPE = 'objectTypes', STATUS_BY_APP = 'statusByApp', STATUS = 'statusTypes', - OUTPUT_SIZE = 'sizes', + OUTPUT_SIZE = 'output_size', IS_DEPRECATED = 'meta.isDeprecated', CSV_ROWS = 'csv_rows', PDF_CPU = 'pdf_cpu', @@ -96,7 +96,14 @@ function getAggStats( ): Partial { const { buckets: jobBuckets } = aggs[keys.JOB_TYPE] as AggregationBuckets; const jobTypes = jobBuckets.reduce((accum: JobTypes, bucket) => { - const { key, doc_count: count, isDeprecated, sizes, layoutTypes, objectTypes } = bucket; + const { + key, + doc_count: count, + isDeprecated, + output_size: outputSizes, + layoutTypes, + objectTypes, + } = bucket; const deprecatedCount = isDeprecated?.doc_count; // format the search results into the telemetry schema @@ -105,7 +112,7 @@ function getAggStats( deprecated: deprecatedCount, app: getKeyCount(get(objectTypes, 'buckets', [])), metrics: (metrics && metrics[key]) || undefined, - sizes: get(sizes, 'values', {} as SizePercentiles), + output_size: get(outputSizes, 'values', {} as SizePercentiles), layout: getKeyCount(get(layoutTypes, 'buckets', [])), }; return { ...accum, [key]: jobType }; diff --git a/x-pack/plugins/reporting/server/usage/schema.test.ts b/x-pack/plugins/reporting/server/usage/schema.test.ts index c82bb5c0df9f0..9b0b866e93a23 100644 --- a/x-pack/plugins/reporting/server/usage/schema.test.ts +++ b/x-pack/plugins/reporting/server/usage/schema.test.ts @@ -40,13 +40,13 @@ describe('Reporting telemetry schema', () => { "PNG.metrics.png_memory.75.0.type": "long", "PNG.metrics.png_memory.95.0.type": "long", "PNG.metrics.png_memory.99.0.type": "long", - "PNG.sizes.1.0.type": "long", - "PNG.sizes.25.0.type": "long", - "PNG.sizes.5.0.type": "long", - "PNG.sizes.50.0.type": "long", - "PNG.sizes.75.0.type": "long", - "PNG.sizes.95.0.type": "long", - "PNG.sizes.99.0.type": "long", + "PNG.output_size.1.0.type": "long", + "PNG.output_size.25.0.type": "long", + "PNG.output_size.5.0.type": "long", + "PNG.output_size.50.0.type": "long", + "PNG.output_size.75.0.type": "long", + "PNG.output_size.95.0.type": "long", + "PNG.output_size.99.0.type": "long", "PNG.total.type": "long", "PNGV2.app.canvas workpad.type": "long", "PNGV2.app.dashboard.type": "long", @@ -62,13 +62,13 @@ describe('Reporting telemetry schema', () => { "PNGV2.metrics.png_memory.75.0.type": "long", "PNGV2.metrics.png_memory.95.0.type": "long", "PNGV2.metrics.png_memory.99.0.type": "long", - "PNGV2.sizes.1.0.type": "long", - "PNGV2.sizes.25.0.type": "long", - "PNGV2.sizes.5.0.type": "long", - "PNGV2.sizes.50.0.type": "long", - "PNGV2.sizes.75.0.type": "long", - "PNGV2.sizes.95.0.type": "long", - "PNGV2.sizes.99.0.type": "long", + "PNGV2.output_size.1.0.type": "long", + "PNGV2.output_size.25.0.type": "long", + "PNGV2.output_size.5.0.type": "long", + "PNGV2.output_size.50.0.type": "long", + "PNGV2.output_size.75.0.type": "long", + "PNGV2.output_size.95.0.type": "long", + "PNGV2.output_size.99.0.type": "long", "PNGV2.total.type": "long", "_all.type": "long", "available.type": "boolean", @@ -82,13 +82,13 @@ describe('Reporting telemetry schema', () => { "csv_searchsource.metrics.csv_rows.75.0.type": "long", "csv_searchsource.metrics.csv_rows.95.0.type": "long", "csv_searchsource.metrics.csv_rows.99.0.type": "long", - "csv_searchsource.sizes.1.0.type": "long", - "csv_searchsource.sizes.25.0.type": "long", - "csv_searchsource.sizes.5.0.type": "long", - "csv_searchsource.sizes.50.0.type": "long", - "csv_searchsource.sizes.75.0.type": "long", - "csv_searchsource.sizes.95.0.type": "long", - "csv_searchsource.sizes.99.0.type": "long", + "csv_searchsource.output_size.1.0.type": "long", + "csv_searchsource.output_size.25.0.type": "long", + "csv_searchsource.output_size.5.0.type": "long", + "csv_searchsource.output_size.50.0.type": "long", + "csv_searchsource.output_size.75.0.type": "long", + "csv_searchsource.output_size.95.0.type": "long", + "csv_searchsource.output_size.99.0.type": "long", "csv_searchsource.total.type": "long", "csv_searchsource_immediate.app.canvas workpad.type": "long", "csv_searchsource_immediate.app.dashboard.type": "long", @@ -100,13 +100,13 @@ describe('Reporting telemetry schema', () => { "csv_searchsource_immediate.metrics.csv_rows.75.0.type": "long", "csv_searchsource_immediate.metrics.csv_rows.95.0.type": "long", "csv_searchsource_immediate.metrics.csv_rows.99.0.type": "long", - "csv_searchsource_immediate.sizes.1.0.type": "long", - "csv_searchsource_immediate.sizes.25.0.type": "long", - "csv_searchsource_immediate.sizes.5.0.type": "long", - "csv_searchsource_immediate.sizes.50.0.type": "long", - "csv_searchsource_immediate.sizes.75.0.type": "long", - "csv_searchsource_immediate.sizes.95.0.type": "long", - "csv_searchsource_immediate.sizes.99.0.type": "long", + "csv_searchsource_immediate.output_size.1.0.type": "long", + "csv_searchsource_immediate.output_size.25.0.type": "long", + "csv_searchsource_immediate.output_size.5.0.type": "long", + "csv_searchsource_immediate.output_size.50.0.type": "long", + "csv_searchsource_immediate.output_size.75.0.type": "long", + "csv_searchsource_immediate.output_size.95.0.type": "long", + "csv_searchsource_immediate.output_size.99.0.type": "long", "csv_searchsource_immediate.total.type": "long", "enabled.type": "boolean", "last7Days.PNG.app.canvas workpad.type": "long", @@ -123,13 +123,13 @@ describe('Reporting telemetry schema', () => { "last7Days.PNG.metrics.png_memory.75.0.type": "long", "last7Days.PNG.metrics.png_memory.95.0.type": "long", "last7Days.PNG.metrics.png_memory.99.0.type": "long", - "last7Days.PNG.sizes.1.0.type": "long", - "last7Days.PNG.sizes.25.0.type": "long", - "last7Days.PNG.sizes.5.0.type": "long", - "last7Days.PNG.sizes.50.0.type": "long", - "last7Days.PNG.sizes.75.0.type": "long", - "last7Days.PNG.sizes.95.0.type": "long", - "last7Days.PNG.sizes.99.0.type": "long", + "last7Days.PNG.output_size.1.0.type": "long", + "last7Days.PNG.output_size.25.0.type": "long", + "last7Days.PNG.output_size.5.0.type": "long", + "last7Days.PNG.output_size.50.0.type": "long", + "last7Days.PNG.output_size.75.0.type": "long", + "last7Days.PNG.output_size.95.0.type": "long", + "last7Days.PNG.output_size.99.0.type": "long", "last7Days.PNG.total.type": "long", "last7Days.PNGV2.app.canvas workpad.type": "long", "last7Days.PNGV2.app.dashboard.type": "long", @@ -145,13 +145,13 @@ describe('Reporting telemetry schema', () => { "last7Days.PNGV2.metrics.png_memory.75.0.type": "long", "last7Days.PNGV2.metrics.png_memory.95.0.type": "long", "last7Days.PNGV2.metrics.png_memory.99.0.type": "long", - "last7Days.PNGV2.sizes.1.0.type": "long", - "last7Days.PNGV2.sizes.25.0.type": "long", - "last7Days.PNGV2.sizes.5.0.type": "long", - "last7Days.PNGV2.sizes.50.0.type": "long", - "last7Days.PNGV2.sizes.75.0.type": "long", - "last7Days.PNGV2.sizes.95.0.type": "long", - "last7Days.PNGV2.sizes.99.0.type": "long", + "last7Days.PNGV2.output_size.1.0.type": "long", + "last7Days.PNGV2.output_size.25.0.type": "long", + "last7Days.PNGV2.output_size.5.0.type": "long", + "last7Days.PNGV2.output_size.50.0.type": "long", + "last7Days.PNGV2.output_size.75.0.type": "long", + "last7Days.PNGV2.output_size.95.0.type": "long", + "last7Days.PNGV2.output_size.99.0.type": "long", "last7Days.PNGV2.total.type": "long", "last7Days._all.type": "long", "last7Days.csv_searchsource.app.canvas workpad.type": "long", @@ -164,13 +164,13 @@ describe('Reporting telemetry schema', () => { "last7Days.csv_searchsource.metrics.csv_rows.75.0.type": "long", "last7Days.csv_searchsource.metrics.csv_rows.95.0.type": "long", "last7Days.csv_searchsource.metrics.csv_rows.99.0.type": "long", - "last7Days.csv_searchsource.sizes.1.0.type": "long", - "last7Days.csv_searchsource.sizes.25.0.type": "long", - "last7Days.csv_searchsource.sizes.5.0.type": "long", - "last7Days.csv_searchsource.sizes.50.0.type": "long", - "last7Days.csv_searchsource.sizes.75.0.type": "long", - "last7Days.csv_searchsource.sizes.95.0.type": "long", - "last7Days.csv_searchsource.sizes.99.0.type": "long", + "last7Days.csv_searchsource.output_size.1.0.type": "long", + "last7Days.csv_searchsource.output_size.25.0.type": "long", + "last7Days.csv_searchsource.output_size.5.0.type": "long", + "last7Days.csv_searchsource.output_size.50.0.type": "long", + "last7Days.csv_searchsource.output_size.75.0.type": "long", + "last7Days.csv_searchsource.output_size.95.0.type": "long", + "last7Days.csv_searchsource.output_size.99.0.type": "long", "last7Days.csv_searchsource.total.type": "long", "last7Days.csv_searchsource_immediate.app.canvas workpad.type": "long", "last7Days.csv_searchsource_immediate.app.dashboard.type": "long", @@ -182,13 +182,13 @@ describe('Reporting telemetry schema', () => { "last7Days.csv_searchsource_immediate.metrics.csv_rows.75.0.type": "long", "last7Days.csv_searchsource_immediate.metrics.csv_rows.95.0.type": "long", "last7Days.csv_searchsource_immediate.metrics.csv_rows.99.0.type": "long", - "last7Days.csv_searchsource_immediate.sizes.1.0.type": "long", - "last7Days.csv_searchsource_immediate.sizes.25.0.type": "long", - "last7Days.csv_searchsource_immediate.sizes.5.0.type": "long", - "last7Days.csv_searchsource_immediate.sizes.50.0.type": "long", - "last7Days.csv_searchsource_immediate.sizes.75.0.type": "long", - "last7Days.csv_searchsource_immediate.sizes.95.0.type": "long", - "last7Days.csv_searchsource_immediate.sizes.99.0.type": "long", + "last7Days.csv_searchsource_immediate.output_size.1.0.type": "long", + "last7Days.csv_searchsource_immediate.output_size.25.0.type": "long", + "last7Days.csv_searchsource_immediate.output_size.5.0.type": "long", + "last7Days.csv_searchsource_immediate.output_size.50.0.type": "long", + "last7Days.csv_searchsource_immediate.output_size.75.0.type": "long", + "last7Days.csv_searchsource_immediate.output_size.95.0.type": "long", + "last7Days.csv_searchsource_immediate.output_size.99.0.type": "long", "last7Days.csv_searchsource_immediate.total.type": "long", "last7Days.output_size.1.0.type": "long", "last7Days.output_size.25.0.type": "long", @@ -218,13 +218,13 @@ describe('Reporting telemetry schema', () => { "last7Days.printable_pdf.metrics.pdf_pages.75.0.type": "long", "last7Days.printable_pdf.metrics.pdf_pages.95.0.type": "long", "last7Days.printable_pdf.metrics.pdf_pages.99.0.type": "long", - "last7Days.printable_pdf.sizes.1.0.type": "long", - "last7Days.printable_pdf.sizes.25.0.type": "long", - "last7Days.printable_pdf.sizes.5.0.type": "long", - "last7Days.printable_pdf.sizes.50.0.type": "long", - "last7Days.printable_pdf.sizes.75.0.type": "long", - "last7Days.printable_pdf.sizes.95.0.type": "long", - "last7Days.printable_pdf.sizes.99.0.type": "long", + "last7Days.printable_pdf.output_size.1.0.type": "long", + "last7Days.printable_pdf.output_size.25.0.type": "long", + "last7Days.printable_pdf.output_size.5.0.type": "long", + "last7Days.printable_pdf.output_size.50.0.type": "long", + "last7Days.printable_pdf.output_size.75.0.type": "long", + "last7Days.printable_pdf.output_size.95.0.type": "long", + "last7Days.printable_pdf.output_size.99.0.type": "long", "last7Days.printable_pdf.total.type": "long", "last7Days.printable_pdf_v2.app.canvas workpad.type": "long", "last7Days.printable_pdf_v2.app.dashboard.type": "long", @@ -247,13 +247,13 @@ describe('Reporting telemetry schema', () => { "last7Days.printable_pdf_v2.metrics.pdf_pages.75.0.type": "long", "last7Days.printable_pdf_v2.metrics.pdf_pages.95.0.type": "long", "last7Days.printable_pdf_v2.metrics.pdf_pages.99.0.type": "long", - "last7Days.printable_pdf_v2.sizes.1.0.type": "long", - "last7Days.printable_pdf_v2.sizes.25.0.type": "long", - "last7Days.printable_pdf_v2.sizes.5.0.type": "long", - "last7Days.printable_pdf_v2.sizes.50.0.type": "long", - "last7Days.printable_pdf_v2.sizes.75.0.type": "long", - "last7Days.printable_pdf_v2.sizes.95.0.type": "long", - "last7Days.printable_pdf_v2.sizes.99.0.type": "long", + "last7Days.printable_pdf_v2.output_size.1.0.type": "long", + "last7Days.printable_pdf_v2.output_size.25.0.type": "long", + "last7Days.printable_pdf_v2.output_size.5.0.type": "long", + "last7Days.printable_pdf_v2.output_size.50.0.type": "long", + "last7Days.printable_pdf_v2.output_size.75.0.type": "long", + "last7Days.printable_pdf_v2.output_size.95.0.type": "long", + "last7Days.printable_pdf_v2.output_size.99.0.type": "long", "last7Days.printable_pdf_v2.total.type": "long", "last7Days.status.completed.type": "long", "last7Days.status.completed_with_warnings.type": "long", @@ -408,13 +408,13 @@ describe('Reporting telemetry schema', () => { "printable_pdf.metrics.pdf_pages.75.0.type": "long", "printable_pdf.metrics.pdf_pages.95.0.type": "long", "printable_pdf.metrics.pdf_pages.99.0.type": "long", - "printable_pdf.sizes.1.0.type": "long", - "printable_pdf.sizes.25.0.type": "long", - "printable_pdf.sizes.5.0.type": "long", - "printable_pdf.sizes.50.0.type": "long", - "printable_pdf.sizes.75.0.type": "long", - "printable_pdf.sizes.95.0.type": "long", - "printable_pdf.sizes.99.0.type": "long", + "printable_pdf.output_size.1.0.type": "long", + "printable_pdf.output_size.25.0.type": "long", + "printable_pdf.output_size.5.0.type": "long", + "printable_pdf.output_size.50.0.type": "long", + "printable_pdf.output_size.75.0.type": "long", + "printable_pdf.output_size.95.0.type": "long", + "printable_pdf.output_size.99.0.type": "long", "printable_pdf.total.type": "long", "printable_pdf_v2.app.canvas workpad.type": "long", "printable_pdf_v2.app.dashboard.type": "long", @@ -437,13 +437,13 @@ describe('Reporting telemetry schema', () => { "printable_pdf_v2.metrics.pdf_pages.75.0.type": "long", "printable_pdf_v2.metrics.pdf_pages.95.0.type": "long", "printable_pdf_v2.metrics.pdf_pages.99.0.type": "long", - "printable_pdf_v2.sizes.1.0.type": "long", - "printable_pdf_v2.sizes.25.0.type": "long", - "printable_pdf_v2.sizes.5.0.type": "long", - "printable_pdf_v2.sizes.50.0.type": "long", - "printable_pdf_v2.sizes.75.0.type": "long", - "printable_pdf_v2.sizes.95.0.type": "long", - "printable_pdf_v2.sizes.99.0.type": "long", + "printable_pdf_v2.output_size.1.0.type": "long", + "printable_pdf_v2.output_size.25.0.type": "long", + "printable_pdf_v2.output_size.5.0.type": "long", + "printable_pdf_v2.output_size.50.0.type": "long", + "printable_pdf_v2.output_size.75.0.type": "long", + "printable_pdf_v2.output_size.95.0.type": "long", + "printable_pdf_v2.output_size.99.0.type": "long", "printable_pdf_v2.total.type": "long", "status.completed.type": "long", "status.completed_with_warnings.type": "long", diff --git a/x-pack/plugins/reporting/server/usage/schema.ts b/x-pack/plugins/reporting/server/usage/schema.ts index 5dcc0d33b6bef..b26ffba23e6a6 100644 --- a/x-pack/plugins/reporting/server/usage/schema.ts +++ b/x-pack/plugins/reporting/server/usage/schema.ts @@ -78,7 +78,7 @@ const availableTotalSchema: MakeSchemaFrom = { available: { type: 'boolean' }, total: { type: 'long' }, deprecated: { type: 'long' }, - sizes: sizesSchema, + output_size: sizesSchema, app: appCountsSchema, }; diff --git a/x-pack/plugins/reporting/server/usage/types.ts b/x-pack/plugins/reporting/server/usage/types.ts index 2e73553b59d2d..e11de7f4765d7 100644 --- a/x-pack/plugins/reporting/server/usage/types.ts +++ b/x-pack/plugins/reporting/server/usage/types.ts @@ -20,7 +20,7 @@ interface DocCount { } interface SizeBuckets { - sizes?: { values: SizePercentiles }; + output_size?: { values: SizePercentiles }; } interface ObjectTypeBuckets { @@ -91,7 +91,7 @@ export interface AvailableTotal { available: boolean; total: number; deprecated?: number; - sizes: SizePercentiles; + output_size: SizePercentiles; app: { search?: number; dashboard?: number; diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index 147ccd81d75b2..f8230be2f5908 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -5818,23 +5818,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -5859,6 +5843,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "metrics": { "properties": { "csv_rows": { @@ -5892,23 +5892,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -5933,6 +5917,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "metrics": { "properties": { "csv_rows": { @@ -5966,23 +5966,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -6007,6 +5991,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "metrics": { "properties": { "png_cpu": { @@ -6056,23 +6056,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -6097,6 +6081,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "metrics": { "properties": { "png_cpu": { @@ -6146,23 +6146,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -6187,6 +6171,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "layout": { "properties": { "canvas": { @@ -6265,23 +6265,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -6306,6 +6290,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "layout": { "properties": { "canvas": { @@ -6924,6 +6924,12 @@ } } }, + "available": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, "last7Days": { "properties": { "csv_searchsource": { @@ -6937,23 +6943,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -6978,6 +6968,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "metrics": { "properties": { "csv_rows": { @@ -7011,23 +7017,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -7052,6 +7042,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "metrics": { "properties": { "csv_rows": { @@ -7085,23 +7091,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -7126,6 +7116,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "metrics": { "properties": { "png_cpu": { @@ -7175,23 +7181,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -7216,6 +7206,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "metrics": { "properties": { "png_cpu": { @@ -7265,23 +7271,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -7306,6 +7296,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "layout": { "properties": { "canvas": { @@ -7384,23 +7390,7 @@ "deprecated": { "type": "long" }, - "app": { - "properties": { - "search": { - "type": "long" - }, - "canvas workpad": { - "type": "long" - }, - "dashboard": { - "type": "long" - }, - "visualization": { - "type": "long" - } - } - }, - "sizes": { + "output_size": { "properties": { "1.0": { "type": "long" @@ -7425,6 +7415,22 @@ } } }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, "layout": { "properties": { "canvas": { @@ -8044,12 +8050,6 @@ } } } - }, - "available": { - "type": "boolean" - }, - "enabled": { - "type": "boolean" } } }, diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/usage/metrics.ts b/x-pack/test/reporting_api_integration/reporting_and_security/usage/metrics.ts index 1ba9f5b55570e..d8645025ef6b8 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/usage/metrics.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/usage/metrics.ts @@ -77,7 +77,7 @@ export default function ({ getService }: FtrProviderContext) { }); it('includes report metrics (not for job types under last_7_days)', async () => { - expect(reporting.printable_pdf.sizes).keys([ + expect(reporting.printable_pdf.output_size).keys([ '1_0', '25_0', '50_0',