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 innodb_read_rows as vttablet metric #7520

Merged
merged 4 commits into from
Feb 22, 2021

Conversation

systay
Copy link
Collaborator

@systay systay commented Feb 19, 2021

We want to be able to track how much work the underlying storage has had to do, not just see how much output there's been.

Related Issue: #7372

@systay systay force-pushed the more-metrics branch 2 times, most recently from f33a58d to b44187e Compare February 19, 2021 13:59
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay added Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature) labels Feb 19, 2021
@systay systay marked this pull request as ready for review February 19, 2021 18:52
@@ -99,6 +100,7 @@ func NewEngine(env tabletenv.Env) *Engine {
_ = env.Exporter().NewGaugeDurationFunc("SchemaReloadTime", "vttablet keeps table schemas in its own memory and periodically refreshes it from MySQL. This config controls the reload time.", se.ticks.Interval)
se.tableFileSizeGauge = env.Exporter().NewGaugesWithSingleLabel("TableFileSize", "tracks table file size", "Table")
se.tableAllocatedSizeGauge = env.Exporter().NewGaugesWithSingleLabel("TableAllocatedSize", "tracks table allocated size", "Table")
se.innoDbReadRowsGauge = env.Exporter().NewGaugesWithSingleLabel("InnodbRowsRead", "number of rows read by mysql", "Database")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a label? Why can't we simply use NewGauge?

Comment on lines 402 to 409
if len(readRowsData.Rows) == 1 && len(readRowsData.Rows[0]) == 2 {
value, err := evalengine.ToInt64(readRowsData.Rows[0][1])
if err != nil {
return err
}

se.innoDbReadRowsGauge.Set("read_rows", value)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should log a message or return an error if the condition is not met.

Signed-off-by: Andres Taylor <andres@planetscale.com>
Copy link
Contributor

@shlomi-noach shlomi-noach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Mental note that we'll probably add more status variables in the future, at which time we'll need to consolidate the show status command. We wouldn't want to run a separate show status like'var' for any single variable we monitor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants