11 ms·
Make sure you generate everything you need when processing data in one pass. ie. you take the last 100 data points, (or what have you), turn that into your grap
by asharp 16y ago
Make sure you generate everything you need when processing data in one pass. ie. you take the last 100 data points, (or what have you), turn that into your graph. Then work on the next set of points, etc.
The key to this is to make sure that everything is constant sized. Don't have anything that has to run over every data point you collect.
As an example, you can take the last 5 minutes worth of data points (as a buffer), and then create a single five minute graph. You can then create an average of the 5 minutes worth of points and move that in to a second buffer which would have say an hours worth of points in 5 minute intervals, etc. Each step has a constant sized buffer and will draw in constant time.
Also, when you view your report, only view pregenerated graphs/tables/etc. It just makes things easier on you, and it stops you from having to care particularly about how long it takes to run your analysis.
- prodigal_erik 16y agoIt's worth noting that a sliding window of summarized monitoring samples is a solved problem: http://en.wikipedia.org/wiki/RRDtool http://en.wikipedia.org/wiki/RRDtool