Bug #53498 Count queries by success/failure in SHOW STATUS
Submitted: 7 May 2010 16:12 Modified: 22 Feb 2011 18:31
Reporter: Mark Callaghan Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: General Severity:S4 (Feature request)
Version:5.1 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: error, queries, show, STATUS

[7 May 2010 16:12] Mark Callaghan
I want counts for all commands by success/failure. The counter names could be: Queries_ok, Queries_error. I think these can be incremented at the end of dispatch_command().

I also want a count for all commands incremented at command start (dispatch_command()). Both the Questions and Queries counters skip a few commands.

With the counters above I can monitoring command arrival and departure rates and can also find periods when error rates are increased.

I don't like that COM_STATISTICS and COM_PING are not counted today in the Questions/Queries counters. I know that they are counted elsewhere, but most people will miss that when debugging a hot server.

How to repeat:

Suggested fix:
Increment Queries_all at the start of dispatch_command().
Increment Queries_ok or Queries_error at the end of dispatch_command()
[7 May 2010 16:44] Valeriy Kravchuk
Thank you for the feature request.
[27 Jul 2010 15:33] James Young
Would like this prioritized for work in MySQL 5.6 if possible.
[22 Feb 2011 18:31] Mark Callaghan
I would also like to log a sample of all errors in a server-side log (general log, slow query log). It is easy to add errno attribute to slow query log. But the error text is also useful and that might require a new log file. For the Facebook patch I added an option to log a sample of all errors to slow query log, but this only gets the errno. The 5.5 audit plugin might make this possible.