~ubuntu-branches/ubuntu/maverick/rrdtool/maverick

« back to all changes in this revision

Viewing changes to doc/rrdgraph_rpn.1

  • 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:
124
124
.\" ========================================================================
125
125
.\"
126
126
.IX Title "RRDGRAPH_RPN 1"
127
 
.TH RRDGRAPH_RPN 1 "2009-02-21" "1.3.8" "rrdtool"
 
127
.TH RRDGRAPH_RPN 1 "2009-10-14" "1.4.3" "rrdtool"
128
128
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
129
129
.\" way too many mistakes in technical documents.
130
130
.if n .ad l
308
308
source value is \s-1NAN\s0 the complete sliding window is affected. The \s-1TRENDNAN\s0 
309
309
operation ignores all NAN-values in a sliding window and computes the 
310
310
average of the remaining values.
 
311
.Sp
 
312
\&\fB\s-1PREDICT\s0, \s-1PREDICTSIGMA\s0\fR
 
313
.Sp
 
314
Create a \*(L"sliding window\*(R" average/sigma of another data series, that also
 
315
shifts the data series by given amounts of of time as well
 
316
.Sp
 
317
Usage \- explicit stating shifts:
 
318
CDEF:predict=<shift n>,...,<shift 1>,n,<window>,x,PREDICT
 
319
CDEF:sigma=<shift n>,...,<shift 1>,n,<window>,x,PREDICTSIGMA
 
320
.Sp
 
321
Usage \- shifts defined as a base shift and a number of time this is applied
 
322
CDEF:predict=<shift multiplier>,\-n,<window>,x,PREDICT
 
323
CDEF:sigma=<shift multiplier>,\-n,<window>,x,PREDICTSIGMA
 
324
.Sp
 
325
Example:
 
326
CDEF:predict=172800,86400,2,1800,x,PREDICT
 
327
.Sp
 
328
This will create a half-hour (1800 second) sliding window average/sigma of x, that
 
329
average is essentially computed as shown here:
 
330
.Sp
 
331
.Vb 10
 
332
\& +\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\-!\-\-\->
 
333
\&                                                                     now
 
334
\&                                                  shift 1        t0
 
335
\&                                         <\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\->
 
336
\&                               window
 
337
\&                         <\-\-\-\-\-\-\-\-\-\-\-\-\-\-\->
 
338
\&                                       shift 2
 
339
\&                 <\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\->
 
340
\&       window
 
341
\& <\-\-\-\-\-\-\-\-\-\-\-\-\-\-\->
 
342
\&                                                      shift 1        t1
 
343
\&                                             <\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\->
 
344
\&                                   window
 
345
\&                             <\-\-\-\-\-\-\-\-\-\-\-\-\-\-\->
 
346
\&                                            shift 2
 
347
\&                     <\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\->
 
348
\&           window
 
349
\&     <\-\-\-\-\-\-\-\-\-\-\-\-\-\-\->
 
350
\&
 
351
\& Value at sample (t0) will be the average between (t0\-shift1\-window) and (t0\-shift1)
 
352
\&                                      and between (t0\-shift2\-window) and (t0\-shift2)
 
353
\& Value at sample (t1) will be the average between (t1\-shift1\-window) and (t1\-shift1)
 
354
\&                                      and between (t1\-shift2\-window) and (t1\-shift2)
 
355
.Ve
 
356
.Sp
 
357
The function is by design NAN-safe. 
 
358
This also allows for extrapolation into the future (say a few days)
 
359
\&\- you may need to define the data series whit the optional start= parameter, so that 
 
360
the source data series has enough data to provide prediction also at the beginning of a graph...
 
361
.Sp
 
362
Here an example, that will create a 10 day graph that also shows the 
 
363
prediction 3 days into the future with its uncertainty value (as defined by avg+\-4*sigma)
 
364
This also shows if the prediction is exceeded at a certain point.
 
365
.Sp
 
366
rrdtool graph image.png \-\-imgformat=PNG \e
 
367
 \-\-start=\-7days \-\-end=+3days \-\-width=1000 \-\-height=200 \-\-alt\-autoscale\-max \e
 
368
 DEF:value=value.rrd:value:AVERAGE:start=\-14days \e
 
369
 LINE1:value#ff0000:value \e
 
370
 CDEF:predict=86400,\-7,1800,value,PREDICT \e
 
371
 CDEF:sigma=86400,\-7,1800,value,PREDICTSIGMA \e
 
372
 CDEF:upper=predict,sigma,3,*,+ \e
 
373
 CDEF:lower=predict,sigma,3,*,\- \e
 
374
 LINE1:predict#00ff00:prediction \e
 
375
 LINE1:upper#0000ff:upper\e certainty\e limit \e
 
376
 LINE1:lower#0000ff:lower\e certainty\e limit \e
 
377
 CDEF:exceeds=value,UN,0,value,lower,upper,LIMIT,UN,IF \e
 
378
 TICK:exceeds#aa000080:1
 
379
.Sp
 
380
Note: Experience has shown that a factor between 3 and 5 to scale sigma is a good 
 
381
discriminator to detect abnormal behavior. This obviously depends also on the type 
 
382
of data and how \*(L"noisy\*(R" the data series is.
 
383
.Sp
 
384
This prediction can only be used for short term extrapolations \- say a few days into the future\-
311
385
.IP "Special values" 4
312
386
.IX Item "Special values"
313
387
\&\fB\s-1UNKN\s0\fR
391
465
.IP "\s-1TOTAL\s0" 4
392
466
.IX Item "TOTAL"
393
467
Returns the rate from each defined time slot multiplied with the
394
 
step size.  This can, for instance, return total bytes transfered
 
468
step size.  This can, for instance, return total bytes transferred
395
469
when you have logged bytes per second. The time component returns
396
470
the number of seconds.
397
471
.Sp
398
472
Example: \f(CW\*(C`VDEF:total=mydata,TOTAL\*(C'\fR
399
 
.IP "\s-1PERCENT\s0" 4
400
 
.IX Item "PERCENT"
 
473
.IP "\s-1PERCENT\s0, \s-1PERCENTNAN\s0" 4
 
474
.IX Item "PERCENT, PERCENTNAN"
401
475
This should follow a \fB\s-1DEF\s0\fR or \fB\s-1CDEF\s0\fR \fIvname\fR. The \fIvname\fR is popped,
402
476
another number is popped which is a certain percentage (0..100). The
403
477
data set is then sorted and the value returned is chosen such that
404
478
\&\fIpercentage\fR percent of the values is lower or equal than the result.
 
479
For \s-1PERCENTNAN\s0 \fIUnknown\fR values are ignored, but for \s-1PERCENT\s0
405
480
\&\fIUnknown\fR values are considered lower than any finite number for this
406
481
purpose so if this operator returns an \fIunknown\fR you have quite a lot
407
482
of them in your data.  \fBInf\fRinite numbers are lesser, or more, than the
409
484
(NaN < \-INF < finite values < \s-1INF\s0)
410
485
.Sp
411
486
Example: \f(CW\*(C`VDEF:perc95=mydata,95,PERCENT\*(C'\fR
 
487
         \f(CW\*(C`VDEF:percnan95=mydata,95,PERCENTNAN\*(C'\fR
412
488
.IP "\s-1LSLSLOPE\s0, \s-1LSLINT\s0, \s-1LSLCORREL\s0" 4
413
489
.IX Item "LSLSLOPE, LSLINT, LSLCORREL"
414
490
Return the parameters for a \fBL\fReast \fBS\fRquares \fBL\fRine \fI(y = mx +b)\fR