mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
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
This commit is contained in:
committed by
Joshua C. Colp
parent
68bb6ef6cb
commit
54a912b26d
@@ -65,6 +65,20 @@ pre-connect => yes
|
||||
; information before we attempt another connection? This increases
|
||||
; responsiveness, when a database resource is not working.
|
||||
;negative_connection_cache => 300
|
||||
;
|
||||
; Enable query logging. This keeps track of the number of prepared queries
|
||||
; and executed queries as well as the query that has taken the longest to
|
||||
; execute. This can be useful for determining the latency with a database.
|
||||
; The data can be viewed using the "odbc show" CLI command.
|
||||
; Note that only successful queries are logged currently.
|
||||
;logging => yes
|
||||
;
|
||||
; Slow query limit. If a query exceeds the given amount of time (in milliseconds)
|
||||
; when executing then a WARNING message will be output to indicate that there
|
||||
; may be a problem. Note that logging must be set to "yes" for this to occur. By
|
||||
; default this is set to 5000 milliseconds (or 5 seconds). If you would like to
|
||||
; disable the WARNING message it can be set to "0".
|
||||
;slow_query_limit => 5000
|
||||
|
||||
[mysql2]
|
||||
enabled => no
|
||||
|
Reference in New Issue
Block a user