Hello,
On 26/12/14 23:08, Olle E. Johansson wrote:
Hi!
I have been digging a bit in statistics vs counters
Kamailio stats is a wrapper round the sr counters.
They are interchangeable - all counters are listed as statistics and all statistics are
listed as counters.
The counters have a bit more functions:
- COnfigurable prefixes
- Descriptions
If I list in-core module stats, some use counters and some use stats.
*** usrloc
location-contacts : 0 (kamailio statistic (no description))
location-expires : 0 (kamailio statistic (no description))
location-users : 0 (kamailio statistic (no description))
registered_users : 0 (kamailio statistic (no description))
USRLOC use kamailio stats without descriptions
The core TCP stats use counters:
*** tcp
con_reset : 0 (total number of TCP_RSTs received on established connections.)
con_timeout : 0 (total number of connections that did timeout (idle for too
long).)
connect_failed : 0 (number of failed active connection attempts.)
The output is from kamcmd using a script I wrote.
I would like to convert as much as possible to counters with built-in descriptions.
Would that create problems? Is there any missing functionality if I do that?
At this point it's a bit confusing with two modules using the same core functions,
so at some point we could make sure that the counters module have the same
functions and RPCs as statistics and merge them.
I think it makes more sense to
move the bare 'statistics' into counters
module, being the one closer to the current core API -- by bare
statistics I mean those that can be defined by mod param, which are
integers with option to increment/decrement in config (what stats module
mainly does).
Statistics module can be dismissed or re-implemented in exposing
something more complex, e.g., doing averages over some counters, like
number of received requests per interval (say 1 hour), keeping the
history for a defined interval (say 3 days), which can be more useful in
detecting special situations...
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda