From: Hannu Nyman Date: Fri, 18 Dec 2020 15:41:18 +0000 (+0200) Subject: luci-app-statistics: shorten delay at graph endpoint to 15s X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b43a5da43e16f016e4fe22425970a649b9c66fdb;p=project%2Fluci.git luci-app-statistics: shorten delay at graph endpoint to 15s Shorten the visible delay at the statistics graph endpoint from 60 seconds to 15 seconds. The 60s delay was recently added as a way to remove a possible visible gap at the end of the hourly graph due to absence of recent data. Default data collection interval is 30s, so that 60s guarantees that there is data upto to the end of the graph. However, that 60s makes any recent activity to get displayed really slowly, after a 60-89 second delay. Shortening the gap to 15s, half of the default data collection period, should balance things: * Half of the time there may be a really narrow gap visible and half of the time there is no gap at all. * The most recent displayed data point is from 15-44 seconds ago (instead of 60-89 seconds ago). Neither 15 or 60 seconds makes any impact to the longer graphs. To accommodate to possibly shorter timespans, and to avoid the occasional wrong data series selected for longer period graphs (see #4065) the endpoint delay might be relative to the timespan. Signed-off-by: Hannu Nyman --- diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js index 4c3c8da5cd..322eee137c 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js @@ -334,7 +334,7 @@ return baseclass.extend({ var cmdline = [ 'graph', '-', '-a', 'PNG', '-s', 'NOW-%s'.format(timespan || this.opts.timespan), - '-e', 'NOW-60', + '-e', 'NOW-15', '-w', width || this.opts.width, '-h', height || this.opts.height ];