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

db: expose interval metrics as cumulative metrics #1954

Closed
jbowens opened this issue Sep 13, 2022 · 0 comments · Fixed by #1966
Closed

db: expose interval metrics as cumulative metrics #1954

jbowens opened this issue Sep 13, 2022 · 0 comments · Fixed by #1966

Comments

@jbowens
Copy link
Collaborator

jbowens commented Sep 13, 2022

InternalIntervalMetrics exposes metrics computed between successive calls to InternalIntervalMetrics. These metrics can be converted to cumulative metrics and exposed on the Metrics struct. This will allow multiple callers to access the metrics (required for cockroachdb/cockroach#85755) and optionally compute deltas between their own successive calls, if necessary.

Temporarily, I think we can duplicate these metrics in Metrics(). Once the existing CockroachDB admission control has been switched over to use the cumulative versions, we can remove InternalIntervalMetrics.

Some metrics will require a little adjustment to be exposed as cumulative values:

SyncQueueUtilization and PendingBufferUtilization — We should wrap these metrics' underlying GaugeSampleMetric with a simple interface that exposes a Subtract method and a Utilization method that will divide by the appropriate constant.

The ThroughputMetrics can be returned as-is, although we might also want to add a Subtract method to this type.

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

Successfully merging a pull request may close this issue.

2 participants