]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_odbc: Add basic query logging.
authorJoshua Colp <jcolp@digium.com>
Wed, 6 Feb 2019 12:16:01 +0000 (12:16 +0000)
committerJoshua C. Colp <jcolp@digium.com>
Thu, 7 Feb 2019 14:23:04 +0000 (08:23 -0600)
commit44254d548b09e0922c1e3c26bcaabe3c2e2c5e26
treefd8235eb5d935359c4705cc5b043e2d3b17221f1
parentc0b7b60ba19bf58ed91f2add2611528a71422c40
res_odbc: Add basic query logging.

When Asterisk is connected and used with a database the response
time of the database can cause problems in Asterisk if it is long.
Normally the only way to see this problem would be to retrieve a
backtrace from Asterisk and examine where things are blocked, or
examine the database to see if there is any indication of a
problem.

This change adds some basic query logging to make it easier to
investigate such a problem. When logging is enabled res_odbc will
now keep track of the number of queries executed, as well as the
query that has taken the longest time to execute. There is also
an option which will cause a WARNING message to be output if a
query takes longer than a configurable amount of time to execute.

This makes it easier and clearer for users that their database may
be experiencing a problem that could impact Asterisk.

ASTERISK-28277

Change-Id: I173cf4928b10754478a6a8c27dfa96ede0f058a6
apps/app_voicemail.c
cdr/cdr_adaptive_odbc.c
cdr/cdr_odbc.c
cel/cel_odbc.c
configs/samples/res_odbc.conf.sample
funcs/func_odbc.c
include/asterisk/res_odbc.h
res/res_config_odbc.c
res/res_odbc.c