luci_statistics: Add y_min, y_max, units_exponent options and clean up some graphs

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
Jo-Philipp Wich 2012-12-14 21:53:03 +00:00
parent ac472f9ebc
commit 99a8b2826e
4 changed files with 17 additions and 0 deletions

View 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

View 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 = {

View 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" }

View 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 = {