[rrd-users] Rrdtool for counting irregular events
Simon Hobson
linux at thehobsons.co.uk
Mon May 21 12:22:57 CEST 2012
Rafal Gwizdala wrote:
>That's a little difficult. My application allows the users to
>specify date range themselves by dragging a selection over the graph
>(just like in Cacti)
Ah yes, that's a bit difficult then.
>So I don't have a control on what the date range will be.
>Anyway, would you mind telling us about your best practices for
>graph range/step calculation?
Well I only have four consolidations in my databases - designed to
for for day, week, month, year graphs. Thus it's simple to
pre-caculate the optimum resolution and timespan values for each
graph. I just use a case statement to pick one of four sets of values
and plug them into the graph generation script.
I carefully choose the timespan of the graph so that each pixel on
the graph exactly matches on consolidated data point.
If you choose any other combination then you won't get more
information in the graph - unless you are storing high res data for a
longer period. So for the consolidations I've chosen, if the user
were to select (say) a 15 day period to graph, then the best they'd
get would be the same data as used for a 31 day graph - so about 2
pixels per data point.
On the other hand, if you store more data (eg 1/2 hour consolidations
for a month instead of a week) then by selecting a 15 day window the
user would then get more information on the graph. There is a lot of
flexibility to trade off storage space vs reporting ability there.
--
Simon Hobson
Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.
More information about the rrd-users
mailing list