From adac251a23472dbcc985ee5850b64a811f02338b Mon Sep 17 00:00:00 2001 From: Hugo Hromic Date: Wed, 28 Jun 2023 13:11:46 +0100 Subject: [PATCH] Units: Add events/messages/records/rows throughput units (#70726) * Adds support for additional throughput units to `valueFormats`. These new units are useful for streaming, e.g. Kafka or RedPanda, and database systems. * Adds missing entries to the dev dashboard tests. --- .../panel_tests_polystat.json | 44 +++++++++++++++++++ .../panel-polystat/polystat_test.json | 44 +++++++++++++++++++ .../src/valueFormats/categories.ts | 8 ++++ 3 files changed, 96 insertions(+) diff --git a/devenv/dev-dashboards-without-uid/panel_tests_polystat.json b/devenv/dev-dashboards-without-uid/panel_tests_polystat.json index d75dad9009b..b42a0110c42 100644 --- a/devenv/dev-dashboards-without-uid/panel_tests_polystat.json +++ b/devenv/dev-dashboards-without-uid/panel_tests_polystat.json @@ -644,6 +644,10 @@ }, { "submenu": [ + { + "text": "counts/sec (cps)", + "value": "cps" + }, { "text": "ops/sec (ops)", "value": "ops" @@ -664,10 +668,34 @@ "text": "I/O ops/sec (iops)", "value": "iops" }, + { + "text": "events/sec (eps)", + "value": "eps" + }, + { + "text": "messages/sec (mps)", + "value": "mps" + }, + { + "text": "records/sec (rps)", + "value": "recps" + }, + { + "text": "rows/sec (rps)", + "value": "rowsps" + }, + { + "text": "counts/min (cpm)", + "value": "cpm" + }, { "text": "ops/min (opm)", "value": "opm" }, + { + "text": "requests/min (rpm)", + "value": "reqpm" + }, { "text": "reads/min (rpm)", "value": "rpm" @@ -675,6 +703,22 @@ { "text": "writes/min (wpm)", "value": "wpm" + }, + { + "text": "events/min (epm)", + "value": "epm" + }, + { + "text": "messages/min (mpm)", + "value": "mpm" + }, + { + "text": "records/min (rpm)", + "value": "recpm" + }, + { + "text": "rows/min (rpm)", + "value": "rowspm" } ], "text": "throughput" diff --git a/devenv/dev-dashboards/panel-polystat/polystat_test.json b/devenv/dev-dashboards/panel-polystat/polystat_test.json index 833c710890c..c965596912a 100644 --- a/devenv/dev-dashboards/panel-polystat/polystat_test.json +++ b/devenv/dev-dashboards/panel-polystat/polystat_test.json @@ -644,6 +644,10 @@ }, { "submenu": [ + { + "text": "counts/sec (cps)", + "value": "cps" + }, { "text": "ops/sec (ops)", "value": "ops" @@ -664,10 +668,34 @@ "text": "I/O ops/sec (iops)", "value": "iops" }, + { + "text": "events/sec (eps)", + "value": "eps" + }, + { + "text": "messages/sec (mps)", + "value": "mps" + }, + { + "text": "records/sec (rps)", + "value": "recps" + }, + { + "text": "rows/sec (rps)", + "value": "rowsps" + }, + { + "text": "counts/min (cpm)", + "value": "cpm" + }, { "text": "ops/min (opm)", "value": "opm" }, + { + "text": "requests/min (rpm)", + "value": "reqpm" + }, { "text": "reads/min (rpm)", "value": "rpm" @@ -675,6 +703,22 @@ { "text": "writes/min (wpm)", "value": "wpm" + }, + { + "text": "events/min (epm)", + "value": "epm" + }, + { + "text": "messages/min (mpm)", + "value": "mpm" + }, + { + "text": "records/min (rpm)", + "value": "recpm" + }, + { + "text": "rows/min (rpm)", + "value": "rowspm" } ], "text": "throughput" diff --git a/packages/grafana-data/src/valueFormats/categories.ts b/packages/grafana-data/src/valueFormats/categories.ts index f91376e4ccd..4ad4863e6f6 100644 --- a/packages/grafana-data/src/valueFormats/categories.ts +++ b/packages/grafana-data/src/valueFormats/categories.ts @@ -382,11 +382,19 @@ export const getCategories = (): ValueFormatCategory[] => [ { name: 'reads/sec (rps)', id: 'rps', fn: simpleCountUnit('rd/s') }, { name: 'writes/sec (wps)', id: 'wps', fn: simpleCountUnit('wr/s') }, { name: 'I/O ops/sec (iops)', id: 'iops', fn: simpleCountUnit('io/s') }, + { name: 'events/sec (eps)', id: 'eps', fn: simpleCountUnit('evt/s') }, + { name: 'messages/sec (mps)', id: 'mps', fn: simpleCountUnit('msg/s') }, + { name: 'records/sec (rps)', id: 'recps', fn: simpleCountUnit('rec/s') }, + { name: 'rows/sec (rps)', id: 'rowsps', fn: simpleCountUnit('rows/s') }, { name: 'counts/min (cpm)', id: 'cpm', fn: simpleCountUnit('c/m') }, { name: 'ops/min (opm)', id: 'opm', fn: simpleCountUnit('ops/m') }, { name: 'requests/min (rpm)', id: 'reqpm', fn: simpleCountUnit('req/m') }, { name: 'reads/min (rpm)', id: 'rpm', fn: simpleCountUnit('rd/m') }, { name: 'writes/min (wpm)', id: 'wpm', fn: simpleCountUnit('wr/m') }, + { name: 'events/min (epm)', id: 'epm', fn: simpleCountUnit('evts/m') }, + { name: 'messages/min (mpm)', id: 'mpm', fn: simpleCountUnit('msgs/m') }, + { name: 'records/min (rpm)', id: 'recpm', fn: simpleCountUnit('rec/m') }, + { name: 'rows/min (rpm)', id: 'rowspm', fn: simpleCountUnit('rows/m') }, ], }, {