[rrd-users] Bar graph by hour, day, month

bsuarez at free.fr bsuarez at free.fr
Mon Sep 29 16:07:21 CEST 2014


My water meter delivers one pulse per liter consumed. I have a script that counts the pulses (raspberry and piface).

Periodically I want to store in the RRD database  the number of pulses.
The first solution is to periodically store the number of impusions since the last backup.
The second solution is to periodically store the total impusions since the start of counting

Which to choose? The second solution requiring an intermediate backup in case of bugs(!) or system reboot

For graphs, displaying data on last 5 minutes, last hour, last day, last month should be enough.

Thank you for your reply.


----- Mail original -----
De: "Simon Hobson" <linux at thehobsons.co.uk>
À: rrd-users at lists.oetiker.ch
Envoyé: Lundi 29 Septembre 2014 11:48:28
Objet: Re: [rrd-users] Bar graph by hour, day, month

Bruno Suarez <bsuarez at free.fr> wrote:

Some clarification is needed, it could be that you are using terms that mean one thing to you and something else to us.

> I want to make graphs of water consumption.
> I have a counter that is incremented for every liter of water consumed,
> this counter will be stored in the database and reset every minute.

Can you clarify that.
I take you mean you'll be reading the counter and updating the RRD file every minute, but does the act of reading the counter reset it to zero or not ?

> In the end I would make graphs (bar) to view the water consumption for
> each period (eg 5 min, 1 hour, 1 day, 1 month ...)

Do you want the bars to match specific time periods - eg have a bar that covers 1st Sept to 30th Sept and so on ?
5 minutes is fairly easy - if your RRD consolidates data to a minimum resolution of 5 minutes then that's what you'll get. But once you get up to days and weeks it gets harder - depending on what you want.
Showing a graph of "the last 7 days" or "the last 31 days" is easy. Doing it for "the last calendar week" (Sun -Sat or Mon-Sun) or "last calendar month" (1st to 28th/30th/31st) is somewhat harder.

rrd-users mailing list
rrd-users at lists.oetiker.ch

More information about the rrd-users mailing list