Graphing a rolling average.
Moderators: Developers, Moderators
-
- Posts: 14
- Joined: Thu May 04, 2006 11:53 am
Graphing a rolling average.
I currently have a data source and graph that show the number of SMTP message delivered per second. I would like a graph that shows the number of messages delivered each hour. Is this possible. I looked at teh CDEF's but I have to admit I am kind of a new to Cacti.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Create a CDEF that looks like to multiply the current data source by 60*60 (seconds * minutes). Apply this new CDEF to the graphed items and the legends as well
Reinhard
Code: Select all
cdef=CURRENT_DATA_SOURCE,3600,*
Reinhard
-
- Posts: 14
- Joined: Thu May 04, 2006 11:53 am
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Oops, I misunderstood. My CDEF will make the results read as "per hour" data instead of "per second".
So you want to poll and display not at standard 5 min interval but at 60 min interval? Or do you want to collect data still every 5 mins but average them out? Or do you want to have TREND information (introduced with rrdtool 1.2.x)?
The TREND thingy is easy, the rest can be done as well but requires some more planning
Reinhard
So you want to poll and display not at standard 5 min interval but at 60 min interval? Or do you want to collect data still every 5 mins but average them out? Or do you want to have TREND information (introduced with rrdtool 1.2.x)?
The TREND thingy is easy, the rest can be done as well but requires some more planning
Reinhard
-
- Posts: 14
- Joined: Thu May 04, 2006 11:53 am
Once again I hav e to admit my ignorance. I wanted to still collect the data every 5 minutes but wanted to average it out. I guess my confusing is coming from the TREND information you are talking about. I am not 100% what the difference is between an average and a trend. Thanks for your continued patient.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
The AVERAGE is computed by rrdtool automatically when "consolidating" data. E.g. rrdtool takes 6 values, adds them and divides them by 6. For the given timespan, this AVERAGE is the only value stored in the rrd file (e.g. covering 2 h).
The TREND is computed every 5 minutes (assuming standard rra definitions) and takes into account a configurable timespan of historical data (e.g. 30 minutes). The resulting value is printed into the graphs but not stored in the database.
Perhaps I'll post a screenshot this week
Reinhard
The TREND is computed every 5 minutes (assuming standard rra definitions) and takes into account a configurable timespan of historical data (e.g. 30 minutes). The resulting value is printed into the graphs but not stored in the database.
Perhaps I'll post a screenshot this week
Reinhard
-
- Posts: 14
- Joined: Thu May 04, 2006 11:53 am
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Find example attached for Traffic Graph Template
The black LINE1 is TRENDed Traffic In/Out, respectively
The TREND CDEF for positive values works quite the same way (substitue -8 by 8 does the trick)
Reinhard
The black LINE1 is TRENDed Traffic In/Out, respectively
The TREND CDEF for positive values works quite the same way (substitue -8 by 8 does the trick)
Reinhard
- Attachments
-
- The CDEF
(multiplying by 8 necessary for Bytes to Bits conversion only) - TREND-CDEF.jpg (110.73 KiB) Viewed 5206 times
- The CDEF
-
- The Graph Template
- Traffic.jpg (204.84 KiB) Viewed 5206 times
-
- TREND in action
- TREND.jpg (81.7 KiB) Viewed 5206 times
-
- Posts: 14
- Joined: Thu May 04, 2006 11:53 am
Hmm, this is cool, but not without flaws.
Hourly is too fine to be useful for my graph of numbers of wireless users, so I want to see a moving 24 hour average.
The CDEF works but seems to break whenever you are displaying less than 24 hours worth of data, or rather not displaying more than 24 hours worth of data. So even on the daily graphs the moving average is not drawn.
Also when in list mode it seems to be broken for any of the time presets given.
Can anyone think of a workaround? I am considering creating a new data source that stores the moving average, then the value will be printable at any resolution.
Hourly is too fine to be useful for my graph of numbers of wireless users, so I want to see a moving 24 hour average.
The CDEF works but seems to break whenever you are displaying less than 24 hours worth of data, or rather not displaying more than 24 hours worth of data. So even on the daily graphs the moving average is not drawn.
Also when in list mode it seems to be broken for any of the time presets given.
Can anyone think of a workaround? I am considering creating a new data source that stores the moving average, then the value will be printable at any resolution.
Yes, you can workaround this by changing your CDEF to 24 hours less one poller period.gandalf wrote:TREND was changed somehow in rrdtool 1.3.x
I did not yet check it out, I only saw this on rrdtool-users mailinglist.
Your first problem, not seeeing a 24h trend on a 24h graph is easily explained: The first trend is graphed only after an initial gap of TREND length.
Reinhard
There is a new TRENDNAN in rrdtool to ignore NANs and still calculate the trend, but perhaps you mean something else? I'll have a look at that list.
cheers
Who is online
Users browsing this forum: No registered users and 4 guests