Merge pull request #450 from hnyman/stat-memory
authorChristian Schoenebeck <christian.schoenebeck@gmail.com>
Mon, 24 Aug 2015 07:49:11 +0000 (09:49 +0200)
committerChristian Schoenebeck <christian.schoenebeck@gmail.com>
Mon, 24 Aug 2015 07:49:11 +0000 (09:49 +0200)
statistics: support better autoscaling in rrdtool, improve memory graph's y-axis

applications/luci-app-statistics/luasrc/statistics/rrdtool.lua
applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/memory.lua

index 1f8f4ff..d8317a8 100644 (file)
@@ -457,6 +457,12 @@ function Graph._generic( self, opts, plugin, plugin_instance, dtype, index )
                        _ti ( _args, "-X" )
                        _ti ( _args, opts.units_exponent )
                end
+               if opts.alt_autoscale then
+                       _ti ( _args, "-A" )
+               end
+               if opts.alt_autoscale_max then
+                       _ti ( _args, "-M" )
+               end
 
                -- store additional rrd options
                if opts.rrdopts then
index a1c65f5..53d559c 100644 (file)
@@ -17,6 +17,8 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
                title = "%H: Memory usage",
                vlabel = "MB",
                number_format = "%5.1lf%s",
+               y_min = "0",
+               alt_autoscale_max = true,
                data = {
                        instances = { 
                                memory = { "free", "buffered", "cached", "used" }