From 3ac22d48d52eb934a6b21b9dd84fe20fc0f28f3e Mon Sep 17 00:00:00 2001 From: Alex <33497058+bexsoft@users.noreply.github.com> Date: Wed, 12 May 2021 19:52:21 -0500 Subject: [PATCH] More Widgets fixes (#739) * Fix the Prometheus queries Signed-off-by: Daniel Valdivia * Add missing steps Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> * Enabled missing axis & fixed labels Co-authored-by: Daniel Valdivia Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> Co-authored-by: Benjamin Perez --- .../screens/Console/Dashboard/Prometheus/utils.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/portal-ui/src/screens/Console/Dashboard/Prometheus/utils.ts b/portal-ui/src/screens/Console/Dashboard/Prometheus/utils.ts index d5ff1b455..8ede27c75 100644 --- a/portal-ui/src/screens/Console/Dashboard/Prometheus/utils.ts +++ b/portal-ui/src/screens/Console/Dashboard/Prometheus/utils.ts @@ -325,6 +325,8 @@ const niceDaysFromNS = (seconds: string) => { return niceDays(seconds, 'ns'); } +const roundNumber = (value: string) => {return parseInt(value).toString(10)}; + export const panelsConfiguration: IDashboardPanel[] = [ { title: "Uptime", @@ -471,8 +473,8 @@ export const panelsConfiguration: IDashboardPanel[] = [ ], type: widgetType.linearGraph, layoutIdentifier: "panel-10", - disableYAxis: true, xAxisFormatter: getTimeFromTimestamp, + yAxisFormatter: niceBytes, }, { title: "Total Open FDs", @@ -505,7 +507,7 @@ export const panelsConfiguration: IDashboardPanel[] = [ ], type: widgetType.linearGraph, layoutIdentifier: "panel-13", - disableYAxis: true, + yAxisFormatter: roundNumber, xAxisFormatter: getTimeFromTimestamp, }, { @@ -521,7 +523,6 @@ export const panelsConfiguration: IDashboardPanel[] = [ ], type: widgetType.linearGraph, layoutIdentifier: "panel-14", - yAxisFormatter: niceBytes, xAxisFormatter: getTimeFromTimestamp, }, { @@ -538,6 +539,7 @@ export const panelsConfiguration: IDashboardPanel[] = [ type: widgetType.linearGraph, layoutIdentifier: "panel-15", xAxisFormatter: getTimeFromTimestamp, + yAxisFormatter: niceBytes, }, { title: "Internode Data Transfer", @@ -598,7 +600,6 @@ export const panelsConfiguration: IDashboardPanel[] = [ ], type: widgetType.linearGraph, layoutIdentifier: "panel-22", - disableYAxis: true, xAxisFormatter: getTimeFromTimestamp, }, { @@ -614,7 +615,6 @@ export const panelsConfiguration: IDashboardPanel[] = [ ], type: widgetType.linearGraph, layoutIdentifier: "panel-23", - disableYAxis: true, xAxisFormatter: getTimeFromTimestamp, yAxisFormatter: niceBytes, }, @@ -631,7 +631,6 @@ export const panelsConfiguration: IDashboardPanel[] = [ ], type: widgetType.linearGraph, layoutIdentifier: "panel-24", - disableYAxis: true, xAxisFormatter: getTimeFromTimestamp, yAxisFormatter: niceBytes, }, @@ -664,7 +663,7 @@ export const panelsConfiguration: IDashboardPanel[] = [ ], type: widgetType.linearGraph, layoutIdentifier: "panel-26", - disableYAxis: true, + yAxisFormatter: roundNumber, xAxisFormatter: getTimeFromTimestamp, }, { @@ -680,7 +679,7 @@ export const panelsConfiguration: IDashboardPanel[] = [ ], type: widgetType.linearGraph, layoutIdentifier: "panel-27", - disableYAxis: true, + yAxisFormatter: roundNumber, xAxisFormatter: getTimeFromTimestamp, }, {