Merge pull request #455 from hnyman/backport-stats
authorhnyman <hannu.nyman@iki.fi>
Sat, 29 Aug 2015 12:48:31 +0000 (15:48 +0300)
committerhnyman <hannu.nyman@iki.fi>
Sat, 29 Aug 2015 12:48:31 +0000 (15:48 +0300)
for-15.05: statistics: Backport recent improvements

applications/luci-app-statistics/luasrc/statistics/rrdtool.lua
applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua
applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/memory.lua
applications/luci-app-statistics/luasrc/view/admin_statistics/index.htm

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 1ca8a23..ae0c0ce 100644 (file)
@@ -8,22 +8,23 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
        return {
                title = "%H: Processor usage on core #%pi",
                y_min = "0",
+               alt_autoscale_max = true,
                vlabel = "Percent",
                number_format = "%5.1lf%%",
                data = {
                        instances = { 
-                               cpu = { "idle", "user", "system", "nice" }
+                               cpu = { "user", "nice", "system", "softirq", "interrupt" }
                        },
 
                        options = {
-                               cpu_idle      = { color = "ffffff" },
-                               cpu_nice      = { color = "00e000" },
-                               cpu_user      = { color = "0000ff" },
-                               cpu_wait      = { color = "ffb000" },
-                               cpu_system    = { color = "ff0000" },
-                               cpu_softirq   = { color = "ff00ff" },
-                               cpu_interrupt = { color = "a000a0" },
-                               cpu_steal     = { color = "000000" }
+                               cpu_idle      = { color = "ffffff", title = "Idle" },
+                               cpu_nice      = { color = "00e000", title = "Nice" },
+                               cpu_user      = { color = "0000ff", title = "User" },
+                               cpu_wait      = { color = "ffb000", title = "Wait" },
+                               cpu_system    = { color = "ff0000", title = "System" },
+                               cpu_softirq   = { color = "ff00ff", title = "Softirq" },
+                               cpu_interrupt = { color = "a000a0", title = "Interrupt" },
+                               cpu_steal     = { color = "000000", title = "Steal" }
                        }
                }
        }
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" }
index 0000c19..0fb3d56 100644 (file)
@@ -8,7 +8,10 @@
 
 <h2><a id="content" name="content"><%:Statistics%></a></h2>
 
-<p><%_The statistics package is based on <a href="http://collectd.org/index.shtml">Collectd</a>
-and uses <a href="http://oss.oetiker.ch/rrdtool/">RRD Tool</a> to render diagram images from collected data.%></p>
+<p><%_The statistics package uses <a href="https://collectd.org/">Collectd</a>
+to gather data and <a href="http://oss.oetiker.ch/rrdtool/">RRDtool</a> to
+render diagram images.%></p>
+
+<p><%_You can install additional collectd-mod-* plugins to enable more statistics.%></p>
 
 <%+footer%>