#1033 closed patch (fixed)

future trends and predictions

Reported by: jiska Owned by: snide
Priority: normal Milestone: Munin 2.0.0
Component: master Version: 1.4.5
Severity: normal Keywords:

Description (last modified by snide)

rrdtool is able to make future trends and predictions. to use this feature, the "--end" argument needs to be somewhere in the future.

this patch introduces 3 new arguments:

graph_future $future_values

graph_future needs to be set to a value like e.g. 50. this value is multiplied with 300s for the day graph, 1500s for the week graph, 7200s for the month graph and 86400s for the year graph. this makes a future prediction of the same "length" in each graph.

graph_future itself only draws a vertical gray line at the current time if no more options are set.

field.trend yes

field.trend generates a future trend for the time that had been set via graph_future with rrdtool's TRENDNAN.
the trend feature can be used together with something like free hard disk space to show when it might be full.

field.predict $period_length,$smoothing_values

field.predict generates a future prediction based on a repeating period using rrdtool's PREDICT. you can set the period length to a day (86400) if you have repeating pattern during that period length. $smooting is a factor of 300s for the day graph (and so on ...). you can set it to 12 to smooth over 12 values.
the prediction feature can be used e.g. for a load graph that is higher during the day and lower during the night.

the color of the prediction/trend is a little lighter than the original field color.

Usage example, to be added in the load plugin :

echo 'graph_future 30'
echo 'load.label load'
echo 'load.trend yes'
echo 'load.predict 86400,12'

Attachments (4)

Config.pm.future.diff (524 bytes) - added by jiska at 2011-02-23T16:24:22+01:00.
Config.pm: added arguments graph_future, predict, trend
GraphOld.pm.future.diff (5.1 KB) - added by jiska at 2011-02-23T16:25:31+01:00.
added graph_future and its options
trend_vs_predict.png (23.9 KB) - added by jiska at 2011-02-23T16:31:26+01:00.
this graph shows the difference between trend and predict
GraphOld.pm.graph_future.diff (5.9 KB) - added by jiska at 2011-03-02T17:25:55+01:00.
patch for trunk

Download all attachments as: .zip

Change History (14)

Changed at 2011-02-23T16:24:22+01:00 by jiska

Config.pm: added arguments graph_future, predict, trend

Changed at 2011-02-23T16:25:31+01:00 by jiska

added graph_future and its options

Changed at 2011-02-23T16:31:26+01:00 by jiska

this graph shows the difference between trend and predict

comment:1 follow-up: Changed at 2011-02-25T16:33:24+01:00 by jorne

This patch is not compatible with trunk: cgi graphing is broken by this patch. Please supply a new patch for GraphOld?.pm.future that is compatible.

Changed at 2011-03-02T17:25:55+01:00 by jiska

patch for trunk

comment:2 in reply to: ↑ 1 ; follow-up: Changed at 2011-03-02T17:28:59+01:00 by jiska

Replying to jorne:
i attached a new patch, GraphOld?.pm.graph_future.diff, i hope it's working for the trunk.

comment:3 in reply to: ↑ 2 ; follow-up: Changed at 2011-03-03T10:04:14+01:00 by jorne

Replying to jiska: This solution still breaks CGI graphing. postponing it until the pending graph-cgi issues in 2.0 have been resolved.

comment:4 in reply to: ↑ 3 Changed at 2011-03-03T13:50:10+01:00 by jiska

Replying to jorne:
how does it break cgi graphing? i tried my patch for munin 1.4.5, munin-graph and cgi graphing were still working and creating graphs as expected.

comment:5 Changed at 2011-04-01T17:16:02+02:00 by snide

  • Owner changed from nobody to snide
  • Status changed from new to assigned

comment:6 Changed at 2011-04-01T17:16:46+02:00 by snide

  • Resolution set to fixed
  • Status changed from assigned to closed

I patched it a little & applied it to trunk (r4151)

comment:7 Changed at 2012-11-16T01:01:38+01:00 by dtamsen

  • Resolution fixed deleted
  • Status changed from closed to reopened

I have successfully enabled trending on munin 2.0.7 with cgi graphing and cgi html. However, it appears that the documentation in the description is not completely correct. After digging through the commit I noticed that in order to successfully graph a trend line you need to set field.trend yes instead of the documented syntax of field.trend.

Per the code you are checking for the following to graph a trend line in the rrd function on line 1552:

if (defined $service->{$fieldname}{'trend'} and $service->{$fieldname}{'trend'} eq 'yes') {

Which checks to see if you have a variable $fieldname.trend' and that the variable is set to yes.

comment:8 Changed at 2012-11-16T16:27:50+01:00 by snide

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from reopened to closed

You're right, but it's the doc which was wrong. Just fixed it.

comment:9 Changed at 2013-03-26T13:34:55+01:00 by snide

  • Description modified (diff)

comment:10 Changed at 2013-03-26T14:26:26+01:00 by snide

  • Description modified (diff)
Note: See TracTickets for help on using tickets.