From d9e548fe0c619c0935926a1dfe4a8f8b9ff810a2 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Thu, 29 Dec 2022 12:11:49 +0200 Subject: [PATCH] luci-app-statistics: provide defaul minimal scale for some graphs Avoid cryptic "200m" axis items for really small values by setting a default minimal y-axis max value for some of the conntrack, cpu, cpufreq, load and ping graphs (mainly percentages). The axis automatically scales upward if necessary, so this just provides a minimal "at least" scale for the y-axis. Signed-off-by: Hannu Nyman --- .../resources/statistics/rrdtool/definitions/conntrack.js | 1 + .../resources/statistics/rrdtool/definitions/cpu.js | 2 ++ .../resources/statistics/rrdtool/definitions/cpufreq.js | 2 ++ .../resources/statistics/rrdtool/definitions/load.js | 1 + .../resources/statistics/rrdtool/definitions/ping.js | 4 ++++ 5 files changed, 10 insertions(+) diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js index 9c54f5c914..35951dffba 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/conntrack.js @@ -33,6 +33,7 @@ return baseclass.extend({ vlabel: "Percent", number_format: "%5.1lf%%", y_min: "0", + y_max: "2", alt_autoscale_max: true, data: { instances: { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js index 796b2cc8d4..bbd0e47642 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js @@ -77,6 +77,7 @@ return baseclass.extend({ var percent = { title: title, y_min: "0", + y_max: "2", alt_autoscale_max: true, vlabel: "Percent", number_format: "%5.1lf%%", @@ -142,6 +143,7 @@ return baseclass.extend({ p = { title: title, y_min: "0", + y_max: "2", alt_autoscale_max: true, vlabel: "Percent", number_format: "%5.1lf%%", diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js index 308d58dacf..a2cc1309e7 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js @@ -26,6 +26,8 @@ return baseclass.extend({ detail: true, title: "%H: Frequency transitions - core %pi", alt_autoscale: true, + y_min: "0", + y_max: "2", vlabel: "Transitions", number_format: "%3.2lf%s", data: { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js index f1a8114463..f3af09895d 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/load.js @@ -11,6 +11,7 @@ return baseclass.extend({ title: "%H: Load", vlabel: "Load", y_min: "0", + y_max: "0.2", units_exponent: "0", number_format: "%5.2lf", data: { diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js index 27624828c2..335e976794 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ping.js @@ -28,6 +28,8 @@ return baseclass.extend({ var droprate = { title: "%H: ICMP Drop Rate", vlabel: "%", + y_min: "0", + y_max: "4", number_format: "%5.2lf %%", data: { types: [ "ping_droprate" ], @@ -45,6 +47,8 @@ return baseclass.extend({ var stddev = { title: "%H: ICMP Standard Deviation", vlabel: "ms", + y_min: "0", + y_max: "1", number_format: "%5.1lf ms", data: { types: [ "ping_stddev" ],