summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/luasrc/statistics
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2016-05-12 10:24:42 +0300
committerHannu Nyman <hannu.nyman@iki.fi>2016-05-12 10:24:42 +0300
commit0c09e4e23f25d95bd3ab2d94a2c84f94f4bcc297 (patch)
tree9f0fd896c556ed6ba223d298bd63197ed95f996e /applications/luci-app-statistics/luasrc/statistics
parent650c0314a60d97b818de1ac73345c49e41602759 (diff)
parentf960a5286896aacbd95a7b95aa367d1584106b2b (diff)
Merge pull request #721 from kdarbyshirebryant/maxrrdtool
Graph the max value rather than avg if rrdsingle disabled
Diffstat (limited to 'applications/luci-app-statistics/luasrc/statistics')
-rw-r--r--applications/luci-app-statistics/luasrc/statistics/rrdtool.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua
index 5d4ad9859d..cd2395e118 100644
--- a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua
+++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua
@@ -171,16 +171,29 @@ function Graph._generic( self, opts, plugin, plugin_instance, dtype, index )
-- is first source in stack or overlay source: source_stk = source_nnl
if not prev or source.overlay then
+ if self.opts.rrasingle then
-- create cdef statement for cumulative stack (no NaNs) and also
-- for display (preserving NaN where no points should be displayed)
_tif( _args, "CDEF:%s_stk=%s_nnl", source.sname, source.sname )
_tif( _args, "CDEF:%s_plot=%s_avg", source.sname, source.sname )
+ else
+ -- create cdef statement for cumulative stack (no NaNs) and also
+ -- for display (preserving NaN where no points should be displayed)
+ _tif( _args, "CDEF:%s_stk=%s_nnl", source.sname, source.sname )
+ _tif( _args, "CDEF:%s_plot=%s_max", source.sname, source.sname )
+ end
-- is subsequent source without overlay: source_stk = source_nnl + previous_stk
else
+ if self.opts.rrasingle then
-- create cdef statement
_tif( _args, "CDEF:%s_stk=%s_nnl,%s_stk,+", source.sname, source.sname, prev )
_tif( _args, "CDEF:%s_plot=%s_avg,%s_stk,+", source.sname, source.sname, prev )
+ else
+ -- create cdef statement
+ _tif( _args, "CDEF:%s_stk=%s_nnl,%s_stk,+", source.sname, source.sname, prev )
+ _tif( _args, "CDEF:%s_plot=%s_max,%s_stk,+", source.sname, source.sname, prev )
+ end
end
-- create multiply by minus one cdef if flip is enabled