~ubuntu-branches/ubuntu/saucy/rrdtool/saucy-proposed

« back to all changes in this revision

Viewing changes to doc/rrdgraph_rpn.pod

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2010-07-22 08:07:01 UTC
  • mfrom: (1.2.8 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100722080701-k46mgdfz6euxwqsm
Tags: 1.4.3-1ubuntu1
* Merge from debian unstable, Remaining changes:
  - debian/control: Don't build against ruby1.9 as we don't want
    it in main.
* require libdbi >= 0.8.3 to prevent aborts when using dbi datasources

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
operation ignores all NAN-values in a sliding window and computes the 
186
186
average of the remaining values.
187
187
 
 
188
B<PREDICT, PREDICTSIGMA>
 
189
 
 
190
Create a "sliding window" average/sigma of another data series, that also
 
191
shifts the data series by given amounts of of time as well
 
192
 
 
193
Usage - explicit stating shifts:
 
194
CDEF:predict=<shift n>,...,<shift 1>,n,<window>,x,PREDICT
 
195
CDEF:sigma=<shift n>,...,<shift 1>,n,<window>,x,PREDICTSIGMA
 
196
 
 
197
Usage - shifts defined as a base shift and a number of time this is applied
 
198
CDEF:predict=<shift multiplier>,-n,<window>,x,PREDICT
 
199
CDEF:sigma=<shift multiplier>,-n,<window>,x,PREDICTSIGMA
 
200
 
 
201
Example:
 
202
CDEF:predict=172800,86400,2,1800,x,PREDICT
 
203
 
 
204
This will create a half-hour (1800 second) sliding window average/sigma of x, that
 
205
average is essentially computed as shown here:
 
206
 
 
207
 +---!---!---!---!---!---!---!---!---!---!---!---!---!---!---!---!---!--->
 
208
                                                                     now
 
209
                                                  shift 1        t0
 
210
                                         <----------------------->
 
211
                               window
 
212
                         <--------------->
 
213
                                       shift 2
 
214
                 <----------------------------------------------->
 
215
       window
 
216
 <--------------->
 
217
                                                      shift 1        t1
 
218
                                             <----------------------->
 
219
                                   window
 
220
                             <--------------->
 
221
                                            shift 2
 
222
                     <----------------------------------------------->
 
223
           window
 
224
     <--------------->
 
225
 
 
226
 Value at sample (t0) will be the average between (t0-shift1-window) and (t0-shift1)
 
227
                                      and between (t0-shift2-window) and (t0-shift2)
 
228
 Value at sample (t1) will be the average between (t1-shift1-window) and (t1-shift1)
 
229
                                      and between (t1-shift2-window) and (t1-shift2)
 
230
 
 
231
 
 
232
The function is by design NAN-safe. 
 
233
This also allows for extrapolation into the future (say a few days)
 
234
- you may need to define the data series whit the optional start= parameter, so that 
 
235
the source data series has enough data to provide prediction also at the beginning of a graph...
 
236
 
 
237
Here an example, that will create a 10 day graph that also shows the 
 
238
prediction 3 days into the future with its uncertainty value (as defined by avg+-4*sigma)
 
239
This also shows if the prediction is exceeded at a certain point.
 
240
 
 
241
rrdtool graph image.png --imgformat=PNG \
 
242
 --start=-7days --end=+3days --width=1000 --height=200 --alt-autoscale-max \
 
243
 DEF:value=value.rrd:value:AVERAGE:start=-14days \
 
244
 LINE1:value#ff0000:value \
 
245
 CDEF:predict=86400,-7,1800,value,PREDICT \
 
246
 CDEF:sigma=86400,-7,1800,value,PREDICTSIGMA \
 
247
 CDEF:upper=predict,sigma,3,*,+ \
 
248
 CDEF:lower=predict,sigma,3,*,- \
 
249
 LINE1:predict#00ff00:prediction \
 
250
 LINE1:upper#0000ff:upper\ certainty\ limit \
 
251
 LINE1:lower#0000ff:lower\ certainty\ limit \
 
252
 CDEF:exceeds=value,UN,0,value,lower,upper,LIMIT,UN,IF \
 
253
 TICK:exceeds#aa000080:1
 
254
 
 
255
Note: Experience has shown that a factor between 3 and 5 to scale sigma is a good 
 
256
discriminator to detect abnormal behavior. This obviously depends also on the type 
 
257
of data and how "noisy" the data series is.
 
258
 
 
259
This prediction can only be used for short term extrapolations - say a few days into the future-
188
260
 
189
261
=item Special values
190
262
 
280
352
=item TOTAL
281
353
 
282
354
Returns the rate from each defined time slot multiplied with the
283
 
step size.  This can, for instance, return total bytes transfered
 
355
step size.  This can, for instance, return total bytes transferred
284
356
when you have logged bytes per second. The time component returns
285
357
the number of seconds.
286
358
 
287
359
Example: C<VDEF:total=mydata,TOTAL>
288
360
 
289
 
=item PERCENT
 
361
=item PERCENT, PERCENTNAN
290
362
 
291
363
This should follow a B<DEF> or B<CDEF> I<vname>. The I<vname> is popped,
292
364
another number is popped which is a certain percentage (0..100). The
293
365
data set is then sorted and the value returned is chosen such that
294
366
I<percentage> percent of the values is lower or equal than the result.
 
367
For PERCENTNAN I<Unknown> values are ignored, but for PERCENT
295
368
I<Unknown> values are considered lower than any finite number for this
296
369
purpose so if this operator returns an I<unknown> you have quite a lot
297
370
of them in your data.  B<Inf>inite numbers are lesser, or more, than the
299
372
(NaN E<lt> -INF E<lt> finite values E<lt> INF)
300
373
 
301
374
Example: C<VDEF:perc95=mydata,95,PERCENT>
 
375
         C<VDEF:percnan95=mydata,95,PERCENTNAN>
302
376
 
303
377
=item LSLSLOPE, LSLINT, LSLCORREL
304
378