in reply to Data structure for statistics
What do you actually want to report? Do you want to be able to view a graph of hits per second for every second of a day, or just for the last N seconds? Ditto minutes, hours, days, weeks, ...?
For edification (and perhaps test) purposes does it make sense to write a test log generator? Can you show us a sample of the output you want to generate? Am I really asking Corion these sorts of questions? :-D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Data structure for statistics
by Corion (Patriarch) on Oct 05, 2008 at 20:05 UTC | |
Heh - yes, an example will surely help. In the long run, I want to display fancy graphs of things, possibly through SVG, PNG or OpenGL, but for the start, I want simple textual output, say, like the following:
Here, avg/s stands for the average number of hits per second, across the whole reporting period, while cur/s stands for the current number of hits per second (or rather, the number of hits in the last second). avg/min stands for the average number of hits per minute, and cur/min for the current number of hits per minute, that is, the number of hits in the last 60 seconds. For /h, it's hour and for /day it's the day. The applications where periods longer than 7 days are interesting are periods where a 10 second or 1 minute resolution will be sufficient. Currently, I'm still looking for a "better" approach than storing all the hits for all the seconds in my time windows, but so far haven't found one. Update: Clarified averages and current. | [reply] [d/l] [select] |
by GrandFather (Saint) on Oct 05, 2008 at 22:35 UTC | |
Something like:
Prints:
Perl reduces RSI - it saves typing | [reply] [d/l] [select] |
by GrandFather (Saint) on Oct 05, 2008 at 20:09 UTC | |
I presume avg is over some modest window time and that cur is an average over a narrow window time. How do those times relate to units (s, min, h ...)? Perl reduces RSI - it saves typing | [reply] |