From carsten@ng-voice.com Mon Jan 12 19:58:25 2015 From: Carsten Bock To: sr-dev@lists.kamailio.org Subject: Re: [sr-dev] git:master:e688d656: modules/cdp: new mod param: workerq_length_threshold_percentage Date: Mon, 12 Jan 2015 19:57:59 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2031652919==" --===============2031652919== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, maybe this is a valid example: http://kamailio.org/docs/modules/devel/modules/dispatcher.html#idp3610384 Kind regards, Carsten 2015-01-12 17:11 GMT+01:00 Richard Good : > Hi > > Sounds like a good idea. > > Please can you elaborate more on what you mean by a script callback via > dedicated route - or point me towards somewhere in kamailio where this is > already used so I can re-use it. > > Regards > > > *Richard Good* > *Senior Manager: Applications & Services* *Smile Communications Pty > (Ltd)* *Mobile:* +27 (0) 72 389 8365 * Skype:* richard.a.good > richard.good(a)smilecoms.com > www.smilecoms.com > > > > > On 12 January 2015 at 16:00, Ovidiu Sas wrote: > >> In addition to the warning, it would be nice to run a script callback via >> a dedicated route, to let the admin take some decisions in real time. >> >> Regards, >> Ovidiu Sas >> On Jan 12, 2015 8:16 AM, "Richard Good" >> wrote: >> >>> Module: kamailio >>> Branch: master >>> Commit: e688d656427dd00d48f1e309c5d8ef991e432b67 >>> URL: >>> https://github.com/kamailio/kamailio/commit/e688d656427dd00d48f1e309c5d8e= f991e432b67 >>> >>> Author: Richard Good >>> Committer: Richard Good >>> Date: 2015-01-12T15:08:08+02:00 >>> >>> modules/cdp: new mod param: workerq_length_threshold_percentage >>> >>> This is the threshold of the length of the worker queue as a percentage >>> of >>> the maximum queue size - when exceeded a warning is written to the log >>> file. Nice to check if worker queue is growing. >>> >>> --- >>> >>> Modified: modules/cdp/doc/cdp_admin.xml >>> Modified: modules/cdp/mod.c >>> Modified: modules/cdp/worker.c >>> >>> --- >>> >>> Diff: >>> https://github.com/kamailio/kamailio/commit/e688d656427dd00d48f1e309c5d8e= f991e432b67.diff >>> Patch: >>> https://github.com/kamailio/kamailio/commit/e688d656427dd00d48f1e309c5d8e= f991e432b67.patch >>> >>> --- >>> >>> diff --git a/modules/cdp/doc/cdp_admin.xml >>> b/modules/cdp/doc/cdp_admin.xml >>> index cdf65d2..234e270 100644 >>> --- a/modules/cdp/doc/cdp_admin.xml >>> +++ b/modules/cdp/doc/cdp_admin.xml >>> @@ -126,6 +126,24 @@ modparam("cdp", "latency_threshold", 1000) >>> >>> >>> >>> +
>>> + workerq_length_threshold_percentage (int) >>> + >>> + The threshold of the length of the worker queue as a >>> percentage of >>> + the maximum queue size - when exceeded a warning is written to >>> the log >>> + file. 0 means disabled >>> + >>> + Default value is 0. >>> >>> + >>> + >>> + Set >>> <varname>workerq_length_threshold_percentage</varname> parameter >>> + >>> + ... >>> +modparam("cdp", "workerq_length_threshold_percentage", 25) >>> +... >>> + >>> + >>> +
>>> >>> >>>
>>> diff --git a/modules/cdp/mod.c b/modules/cdp/mod.c >>> index 6857d82..90900d3 100644 >>> --- a/modules/cdp/mod.c >>> +++ b/modules/cdp/mod.c >>> @@ -62,6 +62,7 @@ char* config_file=3D"DiameterPeer.xml"; /**< >>> default DiameterPeer configuration f >>> unsigned int latency_threshold =3D 500; /**< default >>> threshold for Diameter calls (ms) */ >>> unsigned int *latency_threshold_p =3D &latency_threshold; >>> unsigned int workerq_latency_threshold =3D 100; /**< default threshold >>> for putting a task into worker queue (ms) */ >>> +unsigned int workerq_length_threshold_percentage =3D 0; /**< default >>> threshold for worker queue length, percentage of max queue length - by >>> default disabled */ >>> >>> extern dp_config *config; /**< >>> DiameterPeer configuration structure */ >>> >>> @@ -165,6 +166,7 @@ static param_export_t cdp_params[] =3D { >>> { "config_file", PARAM_STRING, >>> &config_file}, /**< configuration filename */ >>> { "latency_threshold", PARAM_INT, >>> &latency_threshold}, /**>> { "workerq_latency_threshold", PARAM_INT, >>> &workerq_latency_threshold},/**