Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add perf_schema quantile columns to collector #897

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matthewnolf
Copy link

This change appends the 3 quantile columns exposed in the events_statements_summary_by_digest table to the
perf_schema_events_statements collector so that they are available as metrics.

We believe this to be a useful addition so that the various quantiles (p95, p99, p99.5) are available to query and spot changes in performance for a given query. Our use case is to visualise these quantiles for a specific digest to provide more insight than just average query times.

There is mention of adding quantiles in a previous change from a colleague here which wasn't further investigated.

Sample /metrics output that includes the new metrics:

# HELP mysql_perf_schema_events_statements_quantile_95 The 95th percentile of the statement latency, in picoseconds.
# TYPE mysql_perf_schema_events_statements_quantile_95 counter
mysql_perf_schema_events_statements_quantile_95{digest="12fbbd91beb73676bfc7c0cf3cc73d8c29ccc0349a54e367556b6fb7d244a4f8",digest_text="SELECT DISTINCTROW `stack_id` FROM `jobs`",schema="hosted_exporters"} 2.08929613e+08

# HELP mysql_perf_schema_events_statements_quantile_99 The 99th percentile of the statement latency, in picoseconds.
# TYPE mysql_perf_schema_events_statements_quantile_99 counter
mysql_perf_schema_events_statements_quantile_99{digest="12fbbd91beb73676bfc7c0cf3cc73d8c29ccc0349a54e367556b6fb7d244a4f8",digest_text="SELECT DISTINCTROW `stack_id` FROM `jobs`",schema="hosted_exporters"} 2.39883291e+08

# HELP mysql_perf_schema_events_statements_quantile_999 The 99.9th percentile of the statement latency, in picoseconds.
# TYPE mysql_perf_schema_events_statements_quantile_999 counter
mysql_perf_schema_events_statements_quantile_999{digest="12fbbd91beb73676bfc7c0cf3cc73d8c29ccc0349a54e367556b6fb7d244a4f8",digest_text="SELECT DISTINCTROW `stack_id` FROM `jobs`",schema="hosted_exporters"} 1.819700858e+09

@matthewnolf matthewnolf force-pushed the mn/add-quantile branch 2 times, most recently from e603762 to 10e4c0d Compare November 25, 2024 11:52
This change appends the 3 quantile columns exposed in the
events_statements_summary_by_digest table to the
perf_schema_events_statements collector so that they are available
as metrics

Signed-off-by: Matt Nolf <matt.nolf@grafana.com>
@cristiangreco
Copy link
Contributor

@SuperQ could use your thoughts here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants