This commit was generated by cvs2svn to compensate for changes in r11022,
[freeside.git] / torrus / doc / rpnexpr.pod.in
1 #  rpnexpr.pod - Torrus RPN expressions guide
2 #  Copyright (C) 2002  Stanislav Sinyagin
3 #
4 #  This program is free software; you can redistribute it and/or modify
5 #  it under the terms of the GNU General Public License as published by
6 #  the Free Software Foundation; either version 2 of the License, or
7 #  (at your option) any later version.
8 #
9 #  This program is distributed in the hope that it will be useful,
10 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 #  GNU General Public License for more details.
13 #
14 #  You should have received a copy of the GNU General Public License
15 #  along with this program; if not, write to the Free Software
16 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17
18 # $Id: rpnexpr.pod.in,v 1.1 2010-12-27 00:04:31 ivan Exp $
19 # Stanislav Sinyagin <ssinyagin@yahoo.com>
20 #
21 #
22
23 =head1 RPN expressions in Torrus
24
25 In Torrus framework, RPN expressions are the superset of those
26 in RRDtool version 1.0. See the C<rrdtool graph> manual at
27 E<lt>http://oss.oetiker.ch/rrdtool/doc/rrdgraph_rpn.en.htmlE<gt>.
28
29 =head2 New functions added
30
31 =over 4
32
33 =item * NE
34
35 Pops two arguments from stack, and pushes 0 if the arguments are equal,
36 and 1 otherwise.
37
38 =item * AND, OR
39
40 These functions pop two arguments from stack, and push back the result of
41 logical operation. Unlike C operators,
42
43 =item * NOT
44
45 Pops one value from stack and pushes 0 if the argument is nonzero,
46 otherwise 1.
47
48 =item * ABS
49
50 Pops one value from stack and pushes the absolute value of it.
51
52 =item * NOW
53
54 Pushes the current time, in seconds since Epoch.
55
56 =item * MOD
57
58 Equivalent of C<%>, the modulo operator. In Torrus parameter value,
59 percent sign is reserved for parameter substitution.
60
61 =item * NUM
62
63 Returns zero if the argument is undefined, and the argument's numeric value
64 otherwise
65
66 =item * INF, NEGINF
67
68 Returns the positive or negative infinity.
69
70 =back
71
72 =head2 Data access
73
74 In certain context, the values of the datasources can be evaluated
75 into RPN expression.
76
77 The general format for data access is following:
78
79   {FUNC@PATH(-OFFSET)}
80
81 C<FUNC@> specifies a special function to be performed on the
82 data being accessed.
83
84 For monitor expressions, C<T@> returns the timestamp of the data source.
85
86 For C<rrd-cdef> leaf types and for C<rrd-multigraph> datasource types,
87 the following functions affect the graph shape: C<AVERAGE@>, C<MIN@>,
88 C<MAX@>, and C<LAST@>. They cause the corresponding Consolidation Function
89 being used when creating a graph.
90
91 C<PATH> specifies the relative name for the data source.
92 If omitted, the current leaf value is taken. If starts with C</>,
93 the path is considered as absolute.
94 Path starting with letter denotes the child of the parent subtree.
95 Double dot (C<../>) in the beginning of the path is interpreted as
96 current parent's parent subtree.
97
98 C<(OFFSET)> determines the time reference, as described in C<rrdtool fetch>
99 manual. In addition, the word C<LAST> refers to the latest data timestamp
100 available.
101
102 C<(OFFSET)> is currently supported in Monitor expressions only.
103
104 =head1 Author
105
106 Copyright (c) 2002-2004 Stanislav Sinyagin E<lt>ssinyagin@yahoo.comE<gt>