|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
Counters Module
|
|
|
|
|
|
Andrei Pelinescu-Onciul
|
|
@@ -6,7 +5,7 @@ Andrei Pelinescu-Onciul
|
|
|
iptelorg GmbH
|
|
|
|
|
|
Copyright © 2010 iptelorg GmbH
|
|
|
- _________________________________________________________________
|
|
|
+ __________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
|
|
|
@@ -20,9 +19,9 @@ Andrei Pelinescu-Onciul
|
|
|
|
|
|
3. Functions
|
|
|
|
|
|
- 3.1. cnt_inc([group.]name)
|
|
|
- 3.2. cnt_add([group.]name, number)
|
|
|
- 3.3. cnt_reset([group.]name)
|
|
|
+ 3.1. cnt_inc([group.]name)
|
|
|
+ 3.2. cnt_add([group.]name, number)
|
|
|
+ 3.3. cnt_reset([group.]name)
|
|
|
|
|
|
4. counters RPC Functions
|
|
|
|
|
@@ -35,8 +34,8 @@ Andrei Pelinescu-Onciul
|
|
|
|
|
|
List of Examples
|
|
|
|
|
|
- 1.1. Create a new script_counter
|
|
|
- 1.2. Set script_cnt_grp_name in the config file
|
|
|
+ 1.1. Create a new script_counter
|
|
|
+ 1.2. Set script_cnt_grp_name in the config file
|
|
|
1.3. cnt_inc usage
|
|
|
1.4. cnt_add usage
|
|
|
1.5. cnt_reset usage
|
|
@@ -59,9 +58,9 @@ Chapter 1. Admin Guide
|
|
|
|
|
|
3. Functions
|
|
|
|
|
|
- 3.1. cnt_inc([group.]name)
|
|
|
- 3.2. cnt_add([group.]name, number)
|
|
|
- 3.3. cnt_reset([group.]name)
|
|
|
+ 3.1. cnt_inc([group.]name)
|
|
|
+ 3.2. cnt_add([group.]name, number)
|
|
|
+ 3.3. cnt_reset([group.]name)
|
|
|
|
|
|
4. counters RPC Functions
|
|
|
|
|
@@ -74,7 +73,7 @@ Chapter 1. Admin Guide
|
|
|
|
|
|
1. Overview
|
|
|
|
|
|
- This module exports counters/statistics manipulating script functions
|
|
|
+ This module exports counters/statistics manipulating script functions
|
|
|
and RPCs.
|
|
|
|
|
|
2. Parameters
|
|
@@ -85,15 +84,15 @@ Chapter 1. Admin Guide
|
|
|
2.1. script_counter
|
|
|
|
|
|
Define a new counter that can be used from the script. The declaration
|
|
|
- might include a group in front of the counter name, separated with
|
|
|
- '.'. It might also include a counter description string (help
|
|
|
- message), separated from the name with a ' ' or ':'. If the group is
|
|
|
- missing, the group defined in the script_cnt_grp_name module parameter
|
|
|
- will be used (the default is "script"). If the description is missing,
|
|
|
- the default is "custom script counter". The format of the declaration
|
|
|
- is: [group.]name[( |:)description].
|
|
|
-
|
|
|
- Example 1.1. Create a new script_counter
|
|
|
+ might include a group in front of the counter name, separated with '.'.
|
|
|
+ It might also include a counter description string (help message),
|
|
|
+ separated from the name with a ' ' or ':'. If the group is missing, the
|
|
|
+ group defined in the script_cnt_grp_name module parameter will be used
|
|
|
+ (the default is "script"). If the description is missing, the default
|
|
|
+ is "custom script counter". The format of the declaration is:
|
|
|
+ [group.]name[( |:)description].
|
|
|
+
|
|
|
+ Example 1.1. Create a new script_counter
|
|
|
modparam("counters", "script_counter", "foo") # script.foo
|
|
|
modparam("counters", "script_counter", "test.bar") # test.bar
|
|
|
modparam("counters", "script_counter", "baz example counter") # script.baz
|
|
@@ -101,23 +100,23 @@ modparam("counters", "script_counter", "test.x:another example") # test.x
|
|
|
|
|
|
2.2. script_cnt_grp_name
|
|
|
|
|
|
- Group name that will be used for the counters defined via the
|
|
|
+ Group name that will be used for the counters defined via the
|
|
|
script_counter module parameter which do not have a specified group.
|
|
|
|
|
|
Default: "script".
|
|
|
|
|
|
- Example 1.2. Set script_cnt_grp_name in the config file
|
|
|
+ Example 1.2. Set script_cnt_grp_name in the config file
|
|
|
modparam("counters", "script_cnt_grp_name", "my_counters")
|
|
|
|
|
|
3. Functions
|
|
|
|
|
|
- 3.1. cnt_inc([group.]name)
|
|
|
- 3.2. cnt_add([group.]name, number)
|
|
|
- 3.3. cnt_reset([group.]name)
|
|
|
+ 3.1. cnt_inc([group.]name)
|
|
|
+ 3.2. cnt_add([group.]name, number)
|
|
|
+ 3.3. cnt_reset([group.]name)
|
|
|
|
|
|
-3.1. cnt_inc([group.]name)
|
|
|
+3.1. cnt_inc([group.]name)
|
|
|
|
|
|
- Increments the counter group.name. The counter must be defined using
|
|
|
+ Increments the counter group.name. The counter must be defined using
|
|
|
the script_counter module parameter. If the group name is missing, the
|
|
|
group specified by the script_cnt_grp_name modparam will be used.
|
|
|
|
|
@@ -133,9 +132,9 @@ route {
|
|
|
...
|
|
|
}
|
|
|
|
|
|
-3.2. cnt_add([group.]name, number)
|
|
|
+3.2. cnt_add([group.]name, number)
|
|
|
|
|
|
- Adds number the counter group.name. The counter must be defined using
|
|
|
+ Adds number the counter group.name. The counter must be defined using
|
|
|
the script_counter module parameter. If the group name is missing, the
|
|
|
group specified by the script_cnt_grp_name modparam will be used.
|
|
|
|
|
@@ -148,10 +147,10 @@ route {
|
|
|
...
|
|
|
}
|
|
|
|
|
|
-3.3. cnt_reset([group.]name)
|
|
|
+3.3. cnt_reset([group.]name)
|
|
|
|
|
|
- Resets the counter group.name. The counter must be defined using the
|
|
|
- script_counter module parameter. If the group name is missing, the
|
|
|
+ Resets the counter group.name. The counter must be defined using the
|
|
|
+ script_counter module parameter. If the group name is missing, the
|
|
|
group specified by the script_cnt_grp_name modparam will be used.
|
|
|
|
|
|
Example 1.5. cnt_reset usage
|
|
@@ -196,7 +195,7 @@ route {
|
|
|
|
|
|
4.4. cnt.var_list group
|
|
|
|
|
|
- Lists all the names of all the counters belonging to the specified
|
|
|
+ Lists all the names of all the counters belonging to the specified
|
|
|
group.
|
|
|
|
|
|
Example 1.9. cnt.var_list group usage
|