Hi again,
a new stage in developing general support for statistics in openser was
completed:
1) optimization of the Statistic Manager implementation - usage of
atomic ops for i386
2) clean-up and replace old core statistics (former stats.c that
depended on some snmp stuff)
3) replace local module statistics in sl, tm and usrloc with
statistics via the general Manger.
next stage:
1) building a module to provide dynamic script statistics - it will
allow you to perform any kind of counting based of script criteria: you
can count how many calls were sent to GW or voicemail, how many call had
g.729 codec, etc.
2) more statistics in other modules
Available statistics:
Core:
core:rcv_requests - number of received requests
core:rcv_replies - number of received replies
core:fwd_requests - number of stateless forwarded requests
core:fwd_replies - number of stateless forwarded replies (relayed
replies)
core:drop_requests - number of dropped requests (due post/pre script
callbacks or due script execution)
core:drop_replies - number of dropped replies module's reply function
core:err_requests - malformed received requests
core:err_replies - malformed received replies
Shared Memory:
shmem:total_size - total available sh mem
shmem:used_size - used sh mem
shmem:real_used_size - used sh mem including the internal overhead
shmem:max_used_size - maximum of real used memory during execution
shmem:free_size - free shm mem
shmem:fragments - number of sh mem fragments
SL module:
sl:1xx_replies - number of 1xx sent replies
sl:2xx_replies - number of 2xx sent replies
sl:3xx_replies - number of 3xx sent replies
sl:4xx_replies - number of 4xx sent replies
sl:5xx_replies - number of 5xx sent replies
sl:6xx_replies - number of 6xx sent replies
sl:sent_replies - total number of sent replies
sl:sent_err_replies - replies sent via sl_error_send()
sl:received_ACKs - number of received ACKs due sending negative replies
TM module
tm:received_replies - number of statefull received replies
tm:relayed_replies - number of statefull relayed replies
tm:local_replies - number of statefull replies local generated (like
t_reply() )
tm:UAS_transactions - no. of processed UAS transactions (build on
received request)
tm:UAC_transactions - no. of processed UAC transactions (no
received, but only sent request - via t_uac())
tm:2xx_transactions - number of transactions completed via 2xx replies
tm:3xx_transactions - number of transactions completed via 3xx replies
tm:4xx_transactions - number of transactions completed via 4xx replies
tm:5xx_transactions - number of transactions completed via 5xx replies
tm:6xx_transactions - number of transactions completed via 6xx replies
tm:inuse_transactions - how many transactions are still in memory
MSILO module
msilo:stored_messages - no. of messages stored in DB
msilo:dumped_messages - no. of stored messages that were finally
delivered
msilo:failed_messages - no. of stored messages that were discarded
(unable to deliver)
msilo:dumped_reminders - no. of stored reminder messages that were
finally delivered
msilo:failed_reminders - no. of stored reminder messages that were
discarded (unable to deliver)
USRLOC module
usrloc:location-users - number of registered users (AORs)
usrloc:location-contacts - number of registered contacts
usrloc:location-expires - number of contacts that expired
For how to access these statistics (via FIFO), please see my previous email.
regards,
bogdan
Bogdan-Andrei Iancu wrote:
Hi everybody,
A new feature is present on the development version of openser -
Global Statistics Management support: the core includes a Statistics
Manager which roll is to collect statistics variables from all over
openser and to offer management support (to create and operate them);
it also provides a single, centralized point of access to allow
external apps or internal modules to get any statistics.
How it works? the core and the module exports different statistics
variables (via the module interface). The Statistics Manager (SM)
offers support for auto-initialization, for updating ans resetting
variables.
The statistics variables are kept into shared mem to be accessible to
all processes. Synchronization support is offered by SM.
Statistic variable capabilities
-------------------------------
be defined with:
NO_RESET (it cannot be reset -ex. used mem, register
subscribers, etc)
NO_SYNC (it will not be synchronized during ops; by their
nature, some variables are already synchronized)
be updated (added with new val)
be reset (set to zero if allowed).
Accessing the statistics
-------------------------
The SM export two FIFO functions for offering access to the statistics:
"get_statistics all" - gets all statistics
"get_statistics stat_name" - gets the value of the stat_name variable
"get_statistics module_name:" - get all statistics exported by
module "module name"; to get statistics from core, use "core" as
module_name
"reset_statistics stat_name" - sets to 0 the value of the stat_name
variable
The SM internally offers an API to be used by other modules interested
in accessing the statistics. Ex: a future snmp module
Current statistics
------------------
For the moment only a few core statistics are defined (we can easily
add them in time):
received requests : "rcv_reqs"
received replies : "rcv_rpls"
dropped requests (by scripts or post-script callbacks) : "drp_reqs"
dropped replies (by scripts or post-script callbacks) : "drp_rpls"
error requests (basic parsing failed) : "err_reqs"
error replies (bassic parsing failed) : "err_rpls"
How to use it
--------------
first to need to enable its compiling - enable the -DSTATISTICS flag
in Makefile.def (by default is disabled).
Recompile and run openser.
Use fifo to get the statistics. Ex:
openserctl fifo get_statistics all
openserctl fifo get_statistics core:
openserctl fifo get_statistics rcv_reqs
Next steps
-----------
optimization of the SM (better locking for sync, usage of atomic ops
if possible)
replace old statistics (see stats.c) - the code is not compiling since
it depends on some snmp stuff...
replace local module statistics (sl,tm,usrloc) with sttistics via SM
add more statistics...ideas are welcomed
new module to implement dynamic statistics variables to be used from
script.
regards,
bogdan
_______________________________________________
Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users