Query reponse time and Query time histogram not graphing

Bug #954118 reported by Art van Scheppingen on 2012-03-13
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona Monitoring Plugins
Medium
Baron Schwartz

Bug Description

In our setup the Query Response Time and Query Time Histogram are not graphing.

It took me a whle to pinpoint the problem, but I'm happy to say I finally found it:
In the ss_get_mysql_stats.php script the following query gets executed:
SELECT `count`, total * 1000000 AS total FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME WHERE `time` <> 'TOO LONG'

This results in a thirteen row result, which then gets assigned to the $status['Query_time_count_%2d'] and $status['Query_time_total_%2d'] variables. This will assign Query_time_count_00 till Query_time_count_12 and Query_time_total_00 till Query_time_total_12 with a value.

However at line 757 the script will check if the value is set. As Query_time_count_13 and Query_time_total_13 will not be set and the returned value at line 760 is -1.
Since templates are only allowed to contain values ranging from 0 to 18446744073709551615 and not -1 the whole measurement will be deferred.

The fix could be any of the following three options:
1. Change templates to allow -1 value
2. Change templates to only contain 13 data points instead of 14
3. Change the query in the ss_get_mysql_stats.php script

We fixed our instance by patching the ss_get_mysql_stats.php script and remove line 480 containing the where. I've attached our patch for completeness and hopefully it can help others as well.

Baron Schwartz (baron-xaprb) wrote :

Thanks. I was unaware that a single -1 would make the whole measurement be ignored!

Changed in percona-monitoring-plugins:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Baron Schwartz (baron-xaprb)
Changed in percona-monitoring-plugins:
milestone: none → 1.0.0
Changed in percona-monitoring-plugins:
status: Confirmed → Fix Committed
Changed in percona-monitoring-plugins:
status: Fix Committed → New
status: New → Fix Released
Stratos Zolotas (baskin) wrote :

I have the same issue and i'm using 1.0.3 version of the templates. Is the fix applied on this version?

Stratos Zolotas (baskin) wrote :

My mistake. I thought that those graphs would work on standard MySQL.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers