Luci statistics: shorter timespan?

@hnyman And you see within five seconds, the graph updating if you start a download for example?

@hnyman I followed your steps exactly and the graph is still delayed, I have 5 second refresh on and the data is almost a minute behind still.

Well, I have a well tailored SQM, so there is not much bump.

But there actually is a delay of 60 seconds. I didn't notice that angle in your first message, sorry.

LuCI statistics is usually meant for longer-term stats history, so the last few seconds have not been viewed that important for graphs.

In the graph system update in March, jow set it so that independently of the timespan, the last 60 seconds are not attempted to be shown, as there is a likelyhood that data for the last 30-60 seconds may be missing due to the default reporting interval.

You could patch that away in your own router, so that it would try to display until the last seconds.
That is /www/luci-static/resources/statistics/rrdtool.js in a live router.

Reference to discussion in https://github.com/openwrt/luci/issues/4065#issuecomment-629834609

Hi @hnyman,

I edited the js file and removed the -e line and sadly it has not made much difference :frowning:

I cleared /tmp/rrd again and restarted all the services.

Did you also refresh the luci cache ( /tmp/luci* ), restart uhttpd and clear the browser's cache...
The javascript changes are sometimes hard to get to applied.

I usually
rm -rf /tmp/luci*
/etc/init.d/uhttpd restart
(and clear/refresh brower page )

That '-e' (= endpoint) should actually be edited to be just

'-e', 'NOW',

so that the -60 gets removed

Wahey @hnyman that's done it, now within a few seconds of the live data! Amazing you're a hero! :slight_smile:

@hnyman I guess one more question, is it possible to add auto-refresh of once a second? :slight_smile:

I have never tried it. but the 5/30/60 in the selection are defined somewhere in the source code. Just add 1 sec there as an option, and modify the needed bits if it needs further changes.

But that might tax your router's CPU a bit, so depending on your CPU power vs. internet bandwidth, you might see negative effects.

EDIT:

1 Like

Just documenting here, that I shortened the default endpoint delay in master from 60s to 15s with