Paweł,
this can be simpler done with an external script that runs on cron and
periodically fetch the stats you need (via opensipsctl fifo
get_statistics), dump the values somewhere and resets them (via
opensipsctl fifo reset_statistics -
http://www.opensips.org/Resources/DocsCoreMi16#toc11).
Most likely this is where Bogdan is headed but, if you only want to increment
and reset some variables in the script there are global vars available to do
that with. cfgutils module.
#first a var that is shared across all processes
modparam(cfgutils, shvset, didtracker=i:0)
#now one that will
Or you could do this too. :
On Mar 4, 2010, at 5:48 AM, Bogdan-Andrei Iancu wrote:
Paweł,
this can be simpler done with an external script that runs on cron and
periodically fetch the stats you need (via opensipsctl fifo
get_statistics), dump the values somewhere and resets them (via
Hi Richard,
1 important comment here - the global vars are something more powerful
than statistic vars. And of course, they come with more penalties.
Operating with the global vars requires internal locking (over the
variable) - this may lead to a general slowdown of opensips as all the
procs
Good to remember. Thank you. I normally spend tons of time thinking about how
and why I'm accessing the database and file system and no time thinking about
how I'm manipulating variables in script.
While we are on this subject, I've always wondered about something, but not
enough to test
Hi Richard,
definitely there is a difference , but never tried to quantify it - of
course, we can make a simple script to loop 10 times and search for
an AVP in a list of 100 AVPs.
But as searching for an AVP is pure CPU, the question is how relevant is
this difference relative to a DB
Hi Pawel,
for read, the stats vars are available only via the MI interface (the
get_statistics function).
do you want to read the stats from the statistics module only, or all of
them?
Regards,
Bogdan
Paweł Pierścionek wrote:
Hi,
I can update and reset stats variable from within a script.
On 2010-03-03, at 19:20, Bogdan-Andrei Iancu wrote:
Hi Pawel,
for read, the stats vars are available only via the MI interface (the
get_statistics function).
do you want to read the stats from the statistics module only, or all of
them?
Nah, only the ones defined in my