tgharold / CGP

Collectd Graph Panel
http://pommi.nethuis.nl/category/cgp/
2 stars 0 forks source link

jquery - detail graph dynamic refresh rate #4

Closed tgharold closed 11 years ago

tgharold commented 11 years ago

The refresh rate of the graph on the detail page should be calculated on the fly based on an aggressiveness value in the config file along with a true/false flag for turning on auto-refresh.

The aggressiveness value should be range 1..1000, with higher numbers resulting in faster refresh rates. The number of seconds between refreshes can be calculated as (graph width) / (aggressiveness). A default of 200 for the aggressiveness value will probably be fine.

86400 / 200 = 432 seconds between refreshes 7200 / 200 = 36 seconds 28800 / 200 = 144 seconds

For a 1 hour graph (3600 sec), the maximum refresh rate would be 3.6 seconds.