(things-to-do) on the stack and this stack is then processed. The result
will be placed on the stack. At the end, there should be exactly one
number left: the outcome of the series of operations. If there is not
-exactly one number left, rrdtool will complain loudly.
+exactly one number left, RRDtool will complain loudly.
Above multiplication by eight will look like:
-------------------- +
(outcome of the sum)
-As a mathmatical function, this could be written:
+As a mathematical function, this could be written:
C<add(router1.rrd:link1in , router1.rrd:link2in , router2.rrd:link1in , router3.rrd:link1in , router3.rrd:link2.in)>
not matter if you add a to b and then add c to the result or first
add b to c and then add a to the result. This makes it possible to
rewrite the RPN into C<CDEF:result=a,b,c,d,e,+,+,+,+> which is
-evaluatated differently:
+evaluated differently:
push value of variable a on the stack: a
push value of variable b on the stack: a b
similar to one of the expressions in the previous paragraph, only the
multiplication and the addition changed places.
-When you have problems with RPN or when rrdtool is complaining, it's
+When you have problems with RPN or when RRDtool is complaining, it's
usually a Good Thing to write down the stack on a piece of paper
-and see what happens. Have the manual ready and pretend to be rrdtool.
+and see what happens. Have the manual ready and pretend to be RRDtool.
Just do all the math by hand to see what happens, I'm sure this will
solve most, if not all, problems you encounter.
at its current maximum (for positive infinity) or minimum (for negative
infinity) without knowing this maximum (minimum).
-Infinity in rrdtool is mostly used to draw an AREA without knowing its
+Infinity in RRDtool is mostly used to draw an AREA without knowing its
vertical dimensions. You can think of it as drawing an AREA with an
infinite height and displaying only the part that is visible in the
current graph. This is probably a good way to approximate infinity
on purpose. Implementing the second method is described next:
What we want is: "if the value is unknown, replace it with zero". This
-could be writte in pseudo-code as: if (value is unknown) then (zero)
-else (value). When reading the rrdgraph manual you notice the "UN"
+could be written in pseudo-code as: if (value is unknown) then (zero)
+else (value). When reading the L<rrdgraph> manual you notice the "UN"
function that returns zero or one. You also notice the "IF" function
that takes zero or one as input.
C<CDEF:result=value,UN,0,value,IF>
-You may want to read Steve Raders RPN guide if you have difficulties
+You may want to read Steve Rader's RPN guide if you have difficulties
with the way I explained this last example.
-If you want to check this RPN expression, just mimic rrdtools behavior:
+If you want to check this RPN expression, just mimic RRDtool behavior:
For any known value, the expression evaluates as follows:
CDEF:result=value,UN,0,value,IF (value,UN) is not true so it becomes 0
and this is good input to "IF". We want "if (time > 937521357) then
(return a) else (return b)".
-This process was already described toroughly in the previous chapter
+This process was already described thoroughly in the previous chapter
so lets do it quick:
if (x) then a else b
Pseudo code: if (number > 100) then 100 else number.
The second "problem" may also be solved by using the rigid option of
-rrdtool graph, however this has not the same result. In this example
+RRDtool graph, however this has not the same result. In this example
you can end up with a graph that does autoscaling. Also, if you use
the numbers to display maxima they will be set to 100kb/s.
These two parts of the CDEF produce either 0 for false or 1 for true.
We can now check if they are both 0 (or 1) using a few IF statements
but, as Wataru Satoh pointed out, we can use the "*" or "+" functions
-as locical AND and locical OR.
+as logical AND and logical OR.
For "*", the result will be zero (false) if either one of the two
operators is zero. For "+", the result will only be false (0) when
it will effectively overwrite the STACKed parts.
You could combine the two CDEF lines into one (we don't use "allusers")
-if you like. But there are good reasons for writting two CDEFS:
+if you like. But there are good reasons for writing two CDEFS:
=over 4
GPRINT:allusers:AVERAGE:"Average: %6.0lf"
GPRINT:allusers:LAST:"Current: %6.0lf\n"
-=head1 The examples from the rrd graph manual page
+=head1 The examples from the RRD graph manual page
-=head2 Degrees Celcius vs. Degrees Fahrenheit
+=head2 Degrees Celsius vs. Degrees Fahrenheit
rrdtool graph demo.png --title="Demo Graph" \
DEF:cel=demo.rrd:exhaust:AVERAGE \
5. push function "multiply" and process it
6. the resulting value is now "(cel-32)*0.55555"
-Note that if you take the celcius to fahrenheit function you should
+Note that if you take the Celsius to Fahrenheit function you should
be doing "5/9*(cel-32)" so 0.55555 is not exactly correct. It is close
enough for this purpose and it saves a calculation.
"IF" function that returns either "INF" or "UNKN" depending on the
time. This is returned to variable "background".
-The second CDEF has been discussed earlyer in this document so we
+The second CDEF has been discussed earlier in this document so we
won't do that here.
Now you can draw the different layers. Start with the background
LINE3:derivate#000077:derivate
LINE1:var#007700:'raw data'
+
=head1 Out of ideas for now
This document was created from questions asked by either myself or