Code

Imported upstream version 1.4.8
[pkg-rrdtool.git] / doc / rrdgraph_data.txt
1 RRDGRAPH_DATA(1)                    rrdtool                   RRDGRAPH_DATA(1)
5 N\bNA\bAM\bME\bE
6        rrdgraph_data - preparing data for graphing in rrdtool graph
8 S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
9        D\bDE\bEF\bF:\b:_\b<_\bv_\bn_\ba_\bm_\be_\b>=_\b<_\br_\br_\bd_\bf_\bi_\bl_\be_\b>:_\b<_\bd_\bs_\b-_\bn_\ba_\bm_\be_\b>:_\b<_\bC_\bF_\b>[:step=_\b<_\bs_\bt_\be_\bp_\b>][:start=_\b<_\bt_\bi_\bm_\be_\b>][:end=_\b<_\bt_\bi_\bm_\be_\b>][:reduce=_\b<_\bC\bC_\bF\bF_\b>]
11        V\bVD\bDE\bEF\bF:_\bv_\bn_\ba_\bm_\be=_\bR_\bP_\bN _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn
13        C\bCD\bDE\bEF\bF:_\bv_\bn_\ba_\bm_\be=_\bR_\bP_\bN _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn
15 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
16        These three instructions extract data values out of the R\bRR\bRD\bD files,
17        optionally altering them (think, for example, of a bytes to bits
18        conversion). If so desired, you can also define variables containing
19        useful information such as maximum, minimum etcetera. Two of the
20        instructions use a language called R\bRP\bPN\bN which is described in its own
21        manual page.
23        Variable names (_\bv_\bn_\ba_\bm_\be) must be made up strings of the following
24        characters "A-Z, a-z, 0-9, -,_" and a maximum length of 255 characters.
26        When picking variable names, make sure you do not choose a name that is
27        already taken by an RPN operator. A safe bet it to use lowercase or
28        mixed case names for variables since operators will always be in
29        uppercase.
31 D\bDE\bEF\bF
32        D\bDE\bEF\bF:\b:_\b<_\bv_\bn_\ba_\bm_\be_\b>=_\b<_\br_\br_\bd_\bf_\bi_\bl_\be_\b>:_\b<_\bd_\bs_\b-_\bn_\ba_\bm_\be_\b>:_\b<_\bC_\bF_\b>[:step=_\b<_\bs_\bt_\be_\bp_\b>][:start=_\b<_\bt_\bi_\bm_\be_\b>][:end=_\b<_\bt_\bi_\bm_\be_\b>][:reduce=_\b<_\bC\bC_\bF\bF_\b>]
34        This command fetches data from an R\bRR\bRD\bD file.  The virtual name _\bv_\bn_\ba_\bm_\be can
35        then be used throughout the rest of the script. By default, an R\bRR\bRA\bA
36        which contains the correct consolidated data at an appropriate
37        resolution will be chosen.  The resolution can be overridden with the
38        --step option.  The resolution can again be overridden by specifying
39        the s\bst\bte\bep\bp s\bsi\biz\bze\be.  The time span of this data is the same as for the graph
40        by default, you can override this by specifying s\bst\bta\bar\brt\bt a\ban\bnd\bd e\ben\bnd\bd.
41        Remember to escape colons in the time specification!
43        If the resolution of the data is higher than the resolution of the
44        graph, the data will be further consolidated. This may result in a
45        graph that spans slightly more time than requested.  Ideally each point
46        in the graph should correspond with one C\bCD\bDP\bP from an R\bRR\bRA\bA.  For instance,
47        if your R\bRR\bRD\bD has an R\bRR\bRA\bA with a resolution of 1800 seconds per C\bCD\bDP\bP, you
48        should create an image with width 400 and time span 400*1800 seconds
49        (use appropriate start and end times, such as "--start
50        end-8days8hours").
52        If consolidation needs to be done, the C\bCF\bF of the R\bRR\bRA\bA specified in the
53        D\bDE\bEF\bF itself will be used to reduce the data density. This behavior can
54        be changed using ":reduce=_\b<C\bCF\bF_\b>_\b".  This optional parameter specifies the
55        C\bCF\bF to use during the data reduction phase.
57        Example:
59                DEF:ds0=router.rrd:ds0:AVERAGE
60                DEF:ds0weekly=router.rrd:ds0:AVERAGE:step=7200
61                DEF:ds0weekly=router.rrd:ds0:AVERAGE:start=end-1h
62                DEF:ds0weekly=router.rrd:ds0:AVERAGE:start=11\:00:end=start+1h
64 V\bVD\bDE\bEF\bF
65        V\bVD\bDE\bEF\bF:_\bv_\bn_\ba_\bm_\be=_\bR_\bP_\bN _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn
67        This command returns a value and/or a time according to the R\bRP\bPN\bN
68        statements used. The resulting _\bv_\bn_\ba_\bm_\be will, depending on the functions
69        used, have a value and a time component.  When you use this _\bv_\bn_\ba_\bm_\be in
70        another R\bRP\bPN\bN expression, you are effectively inserting its value just as
71        if you had put a number at that place.  The variable can also be used
72        in the various graph and print elements.
74        Example: "VDEF:avg=mydata,AVERAGE"
76        Note that currently only aggregation functions work in VDEF rpn
77        expressions.  Patches to change this are welcome.
79 C\bCD\bDE\bEF\bF
80        C\bCD\bDE\bEF\bF:_\bv_\bn_\ba_\bm_\be=_\bR_\bP_\bN _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn
82        This command creates a new set of data points (in memory only, not in
83        the R\bRR\bRD\bD file) out of one or more other data series. The R\bRP\bPN\bN
84        instructions are used to evaluate a mathematical function on each data
85        point. The resulting _\bv_\bn_\ba_\bm_\be can then be used further on in the script,
86        just as if it were generated by a D\bDE\bEF\bF instruction.
88        Example: "CDEF:mydatabits=mydata,8,*"
90 A\bAb\bbo\bou\but\bt C\bCD\bDE\bEF\bF v\bve\ber\brs\bsu\bus\bs V\bVD\bDE\bEF\bF
91        At some point in processing, R\bRR\bRD\bDt\bto\boo\bol\bl has gathered an array of rates
92        ready to display.
94        C\bCD\bDE\bEF\bF works on such an array.  For example, _\bC_\bD_\bE_\bF_\b:_\bn_\be_\bw_\b=_\bd_\bs_\b0_\b,_\b8_\b,_\b* would
95        multiply each of the array members by eight (probably transforming
96        bytes into bits). The result is an array containing the new values.
98        V\bVD\bDE\bEF\bF also works on such an array but in a different way.  For example,
99        _\bV_\bD_\bE_\bF_\b:_\bm_\ba_\bx_\b=_\bd_\bs_\b0_\b,_\bM_\bA_\bX_\bI_\bM_\bU_\bM would scan each of the array members and store the
100        maximum value.
102    W\bWh\bhe\ben\bn d\bdo\bo y\byo\bou\bu u\bus\bse\be V\bVD\bDE\bEF\bF v\bve\ber\brs\bsu\bus\bs C\bCD\bDE\bEF\bF?\b?
103        Use C\bCD\bDE\bEF\bF to transform your data prior to graphing.  In the above
104        example, we'd use a C\bCD\bDE\bEF\bF to transform bytes to bits before graphing the
105        bits.
107        You use a V\bVD\bDE\bEF\bF if you want _\bm_\ba_\bx_\b(_\b1_\b,_\b5_\b,_\b3_\b,_\b2_\b,_\b4_\b) to return five which would be
108        displayed in the graph's legend (to answer, what was the maximum value
109        during the graph period).
111        If you want to apply 'complex' operations to the result of a VDEF you
112        have to use a CDEF again since VDEFs only look like RPN expressions,
113        they aren't really.
115 S\bSE\bEE\bE A\bAL\bLS\bSO\bO
116        rrdgraph gives an overview of how r\brr\brd\bdt\bto\boo\bol\bl g\bgr\bra\bap\bph\bh works.  rrdgraph_data
117        describes D\bDE\bEF\bF,C\bCD\bDE\bEF\bF and V\bVD\bDE\bEF\bF in detail.  rrdgraph_rpn describes the R\bRP\bPN\bN
118        language used in the ?\b?D\bDE\bEF\bF statements.  rrdgraph_graph page describes
119        all of the graph and print functions.
121        Make sure to read rrdgraph_examples for tips&tricks.
123 A\bAU\bUT\bTH\bHO\bOR\bR
124        Program by Tobias Oetiker <tobi@oetiker.ch>
126        This manual page by Alex van den Bogaerdt <alex@vandenbogaerdt.nl> with
127        corrections and/or additions by several people
131 1.4.8                             2013-05-23                  RRDGRAPH_DATA(1)