luci_statistics: Add y_min, y_max, units_exponent options and clean up some graphs
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 14 Dec 2012 21:53:03 +0000 (21:53 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 14 Dec 2012 21:53:03 +0000 (21:53 +0000)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
applications/luci-statistics/luasrc/statistics/rrdtool.lua
applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua
applications/luci-statistics/luasrc/statistics/rrdtool/definitions/load.lua
applications/luci-statistics/luasrc/statistics/rrdtool/definitions/nut.lua

index e93ac0628ad7f8c3fcc30c43284df305580f78a0..dbcae9dc6be42c79701c4a61662c0b6deac719f4 100644 (file)
@@ -457,6 +457,18 @@ function Graph._generic( self, opts, plugin, plugin_instance, dtype, index )
                _ti( _args, self.i18n:title( plugin, plugin_instance, _sources[1].type, instance, opts.title ) )
                _ti( _args, "-v" )
                _ti( _args, self.i18n:label( plugin, plugin_instance, _sources[1].type, instance, opts.vlabel ) )
+               if opts.y_max then
+                       _ti ( _args, "-u" )
+                       _ti ( _args, opts.y_max )
+               end
+               if opts.y_min then
+                       _ti ( _args, "-l" )
+                       _ti ( _args, opts.y_min )
+               end
+               if opts.units_exponent then
+                       _ti ( _args, "-X" )
+                       _ti ( _args, opts.units_exponent )
+               end
 
                -- store additional rrd options
                if opts.rrdopts then
index adc3f284b2446de35eb5950393775f945365fbfb..c0e86245c093f52cabaea47369e23fe2ea033be1 100644 (file)
@@ -19,6 +19,7 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
 
        return {
                title = "%H: Processor usage on core #%pi",
+               y_min = "0",
                vlabel = "Percent",
                number_format = "%5.1lf%%",
                data = {
index 8052696fb503fa538e886aae1d818d2b68aeb895..4cb4795ef6465cef14eda3747cd721d8deadf83b 100644 (file)
@@ -19,6 +19,8 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
 
        return {
                title = "%H: Load", vlabel = "Load",
+               y_min = "0",
+               units_exponent = "0",
                number_format = "%5.2lf", data = {
                        sources = {
                                load = { "shortterm", "midterm", "longterm" }
index 4072d4db149187eed942c4dde58e492fdbfa279c..69f1ae305cb4d8208f8cefe080d4cf36f422c930 100644 (file)
@@ -53,6 +53,8 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
        local percentage = {
                title = "%H: Battery charge on UPS \"%pi\"",
                vlabel = "Percent",
+               y_min = "0",
+               y_max = "100",
                number_format = "%5.1lf%%",
                data = {
                        sources = {