← Volver al índice de módulos

benchmark

This module helps developers to benchmark their module functions. By adding this module's functions via the configuration file or through its API, Kamailio can log profiling information for every func
🛠️ Utilidades y Varios Kamailio 6.1 8 parámetros 4 funciones

Descripción general

This module helps developers to benchmark their module functions. By adding this module's functions via the configuration file or through its API, Kamailio can log profiling information for every function. The duration between calls to bm_start_timer() and bm_log_timer() is stored and logged via Kamailio's logging facility. Please note that all durations are given as microseconds (do not confuse with milliseconds). Support for nanosecond precission can be enabled by compiling with librt (see the Makefile of the module). Note: the measurement can be done only in the context of the same application process. It does not work to measure the duration of execution between actions before suspending the transaction in one process and after resuming the processing in another process (e.g., functions from async or http_async_client modules).

Documentación oficial: https://www.kamailio.org/docs/modules/stable/modules/benchmark.html
Código fuente: https://github.com/kamailio/kamailio/tree/master/src/modules/benchmark

Parámetros de configuración

ParámetroTipoDescripción
enable int 3.2. granularity (int) 3.3. loglevel (int) 3.4. register (str)
granularity int 3.3. loglevel (int) 3.4. register (str)
loglevel int 3.4. register (str)
register str 3.1. enable (int)
enable int Even when the module is loaded, benchmarking is not enabled per default. This variable may have three different values: * -1 - Globally disable benchmarking * 0 - Enable per-timer enabling. Single tim
granularity int Logging normally is not done for every reference to the log_timer() function, but only every n'th call. n is defined through this variable. A sensible granularity seems to be 100.
loglevel int Set the log level for the benchmark logs. These levels should be used: * -5 - L_ALERT * -4 - L_BUG * -3 - L_CRIT * -2 - L_CRIT (no prefix) * -1 - L_ERR * 0 - L_WARN * 1 - L_NOTICE * 2 - L_INFO * 3 - L
register str Register a timer id at startup. Required when using the start/log functions via Kemi framework. This parameter can be set many times to register several timer ids.

Funciones exportadas

bm_start_timer(name)

4.2. bm_log_timer(name)

bm_log_timer(name)

4.1. bm_start_timer(name)

bm_start_timer(name)

Start timer “name”. A later call to “bm_log_timer()” logs this timer..

bm_log_timer(name)

This function logs the timer with the given ID. The following data are logged: * Last msgs is the number of calls in the last logging interval. This equals the granularity variable.

Autores y contribuidores

Bastian FriedrichCollax GmbH <bastian.friedrich@collax.com>Daniel-Constantin Mierla <miconda@gmail.com>Bastian Friedrich <bastian.friedrich@collax.com>

Copyright © 2007 Collax GmbH
Copyright © 2007 Voice System SRL

Módulos relacionados

auth_web3 auth_xkeys avp avpops blst call_control call_obj cfg_db