X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=doc%2Frrdgraph_rpn.txt;h=ae5cfdcb386dcf52b20093d6db7578e21580d540;hb=d9822df7ed5e8122cf3a62e4e99678e94007f504;hp=327dc0d6629813faf8ab0f71d0e026160f6f20a6;hpb=ffa00ac697dccce18dca8880ca7a14066521ac5c;p=pkg-rrdtool.git diff --git a/doc/rrdgraph_rpn.txt b/doc/rrdgraph_rpn.txt index 327dc0d..ae5cfdc 100644 --- a/doc/rrdgraph_rpn.txt +++ b/doc/rrdgraph_rpn.txt @@ -11,17 +11,17 @@ SSYYNNOOPPSSIISS DDEESSCCRRIIPPTTIIOONN If you have ever used a traditional HP calculator you already know RRPPNN (Reverse Polish Notation). The idea behind RRPPNN is that you have a - stack and push your data onto this stack. Whenever you execute an oper- - ation, it takes as many elements from the stack as needed. Pushing is - done implicitly, so whenever you specify a number or a variable, it + stack and push your data onto this stack. Whenever you execute an + operation, it takes as many elements from the stack as needed. Pushing + is done implicitly, so whenever you specify a number or a variable, it gets pushed onto the stack automatically. At the end of the calculation there should be one and only one value left on the stack. This is the outcome of the function and this is - what is put into the _v_n_a_m_e. For CCDDEEFF instructions, the stack is pro- - cessed for each data point on the graph. VVDDEEFF instructions work on an - entire data set in one run. Note, that currently VVDDEEFF instructions only - support a limited list of functions. + what is put into the _v_n_a_m_e. For CCDDEEFF instructions, the stack is + processed for each data point on the graph. VVDDEEFF instructions work on + an entire data set in one run. Note, that currently VVDDEEFF instructions + only support a limited list of functions. Example: "VDEF:maximum=mydata,MAXIMUM" @@ -30,9 +30,9 @@ DDEESSCCRRIIPPTTIIOONN Example: "CDEF:mydatabits=mydata,8,*" - This means: push variable _m_y_d_a_t_a, push the number 8, execute the oper- - ator _*. The operator needs two elements and uses those to return one - value. This value is then stored in _m_y_d_a_t_a_b_i_t_s. As you may have + This means: push variable _m_y_d_a_t_a, push the number 8, execute the + operator _*. The operator needs two elements and uses those to return + one value. This value is then stored in _m_y_d_a_t_a_b_i_t_s. As you may have guessed, this instruction means nothing more than _m_y_d_a_t_a_b_i_t_s _= _m_y_d_a_t_a _* _8. The real power of RRPPNN lies in the fact that it is always clear in which order to process the input. For expressions like "a = b + 3 * 5" @@ -44,15 +44,16 @@ OOPPEERRAATTOORRSS Boolean operators LLTT,, LLEE,, GGTT,, GGEE,, EEQQ,, NNEE - Pop two elements from the stack, compare them for the selected con- - dition and return 1 for true or 0 for false. Comparing an _u_n_k_n_o_w_n - or an _i_n_f_i_n_i_t_e value will always result in 0 (false). + Pop two elements from the stack, compare them for the selected + condition and return 1 for true or 0 for false. Comparing an + _u_n_k_n_o_w_n or an _i_n_f_i_n_i_t_e value will result in _u_n_k_n_o_w_n returned ... + which will also be treated as false by the IIFF call. UUNN,, IISSIINNFF - Pop one element from the stack, compare this to _u_n_k_n_o_w_n respec- - tively to _p_o_s_i_t_i_v_e _o_r _n_e_g_a_t_i_v_e _i_n_f_i_n_i_t_y. Returns 1 for true or 0 - for false. + Pop one element from the stack, compare this to _u_n_k_n_o_w_n + respectively to _p_o_s_i_t_i_v_e _o_r _n_e_g_a_t_i_v_e _i_n_f_i_n_i_t_y. Returns 1 for true + or 0 for false. IIFF @@ -70,8 +71,8 @@ OOPPEERRAATTOORRSS Pops two elements from the stack and returns the smaller or larger, respectively. Note that _i_n_f_i_n_i_t_e is larger than anything else. If - one of the input numbers is _u_n_k_n_o_w_n then the result of the opera- - tion will be _u_n_k_n_o_w_n too. + one of the input numbers is _u_n_k_n_o_w_n then the result of the + operation will be _u_n_k_n_o_w_n too. LLIIMMIITT @@ -102,8 +103,8 @@ OOPPEERRAATTOORRSS SSIINN,, CCOOSS,, LLOOGG,, EEXXPP,, SSQQRRTT - Sine and cosine (input in radians), log and exp (natural loga- - rithm), square root. + Sine and cosine (input in radians), log and exp (natural + logarithm), square root. AATTAANN @@ -112,12 +113,13 @@ OOPPEERRAATTOORRSS AATTAANN22 Arctangent of y,x components (output in radians). This pops one - element from the stack, the x (cosine) component, and then a sec- - ond, which is the y (sine) component. It then pushes the arctan- - gent of their ratio, resolving the ambiguity between quadrants. + element from the stack, the x (cosine) component, and then a + second, which is the y (sine) component. It then pushes the + arctangent of their ratio, resolving the ambiguity between + quadrants. - Example: "CDEF:angle=Y,X,ATAN2,RAD2DEG" will convert "X,Y" compo- - nents into an angle in degrees. + Example: "CDEF:angle=Y,X,ATAN2,RAD2DEG" will convert "X,Y" + components into an angle in degrees. FFLLOOOORR,, CCEEIILL @@ -167,6 +169,7 @@ OOPPEERRAATTOORRSS delay t2 <---------------> + Value at sample (t0) will be the average between (t0-delay) and (t0) Value at sample (t1) will be the average between (t1-delay) and (t1) Value at sample (t2) will be the average between (t2-delay) and (t2) @@ -183,8 +186,8 @@ OOPPEERRAATTOORRSS well Usage - explicit stating shifts: CDEF:predict=,...,,n,,x,PREDICT CDEF:sigma=,...,,n,,x,PREDICTSIGMA + 1>,n,,x,PREDICT CDEF:sigma=,...,,n,,x,PREDICTSIGMA Usage - shifts defined as a base shift and a number of time this is applied CDEF:predict=,-n,,x,PREDICT @@ -192,8 +195,9 @@ OOPPEERRAATTOORRSS Example: CDEF:predict=172800,86400,2,1800,x,PREDICT - This will create a half-hour (1800 second) sliding window aver- - age/sigma of x, that average is essentially computed as shown here: + This will create a half-hour (1800 second) sliding window + average/sigma of x, that average is essentially computed as shown + here: +---!---!---!---!---!---!---!---!---!---!---!---!---!---!---!---!---!---> now @@ -219,11 +223,11 @@ OOPPEERRAATTOORRSS Value at sample (t1) will be the average between (t1-shift1-window) and (t1-shift1) and between (t1-shift2-window) and (t1-shift2) - The function is by design NAN-safe. This also allows for extrapo- - lation into the future (say a few days) - you may need to define - the data series whit the optional start= parameter, so that the - source data series has enough data to provide prediction also at - the beginning of a graph... + The function is by design NAN-safe. This also allows for + extrapolation into the future (say a few days) - you may need to + define the data series whit the optional start= parameter, so that + the source data series has enough data to provide prediction also + at the beginning of a graph... Here an example, that will create a 10 day graph that also shows the prediction 3 days into the future with its uncertainty value @@ -246,7 +250,7 @@ OOPPEERRAATTOORRSS TICK:exceeds#aa000080:1 Note: Experience has shown that a factor between 3 and 5 to scale - sigma is a good discriminator to detect abnormal behaviour. This + sigma is a good discriminator to detect abnormal behavior. This obviously depends also on the type of data and how "noisy" the data series is. @@ -268,8 +272,8 @@ OOPPEERRAATTOORRSS Pushes an _u_n_k_n_o_w_n value if this is the first value of a data set or otherwise the result of this CCDDEEFF at the previous time step. This - allows you to do calculations across the data. This function can- - not be used in VVDDEEFF instructions. + allows you to do calculations across the data. This function + cannot be used in VVDDEEFF instructions. PPRREEVV((vvnnaammee)) @@ -287,7 +291,7 @@ OOPPEERRAATTOORRSS Time Time inside RRDtool is measured in seconds since the epoch. The - epoch is defined to be "Thu Jan 1 00:00:00 UTC 1970". + epoch is defined to be "Thu Jan 1 00:00:00 UTC 1970". NNOOWW @@ -301,9 +305,9 @@ OOPPEERRAATTOORRSS LLTTIIMMEE Takes the time as defined by TTIIMMEE, applies the time zone offset - valid at that time including daylight saving time if your OS sup- - ports it, and pushes the result on the stack. There is an elabo- - rate example in the examples section below on how to use this. + valid at that time including daylight saving time if your OS + supports it, and pushes the result on the stack. There is an + elaborate example in the examples section below on how to use this. Processing the stack directly DDUUPP,, PPOOPP,, EEXXCC @@ -329,15 +333,14 @@ VVAARRIIAABBLLEESS Example: "VDEF:stdev=mydata,STDEV" LAST, FIRST - Return the last/first value including its time. The time for FIRST - is actually the start of the corresponding interval, whereas LAST - returns the end of the corresponding interval. + Return the last/first non-nan or infinite value for the selected + data stream, including its timestamp. Example: "VDEF:first=mydata,FIRST" TOTAL Returns the rate from each defined time slot multiplied with the - step size. This can, for instance, return total bytes transfered + step size. This can, for instance, return total bytes transferred when you have logged bytes per second. The time component returns the number of seconds. @@ -365,8 +368,8 @@ VVAARRIIAABBLLEESS y-intercept _(_b_), which happens also to be the first data point on the graph. LSLCORREL is the Correlation Coefficient (also know as Pearson's Product Moment Correlation Coefficient). It will range - from 0 to +/-1 and represents the quality of fit for the approxima- - tion. + from 0 to +/-1 and represents the quality of fit for the + approximation. Example: "VDEF:slope=mydata,LSLSLOPE" @@ -386,4 +389,4 @@ AAUUTTHHOORR -1.3.99909060808 2009-02-21 RRDGRAPH_RPN(1) +1.4.8 2013-05-23 RRDGRAPH_RPN(1)