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

Refactor/952 add metric for spanner pool get #1044

Merged
merged 4 commits into from
Apr 15, 2021

Conversation

ethowitz
Copy link
Contributor

Description

Adds a timer that tracks the time it takes to get a new Spanner pool. It seemed like this was the right approach based on other areas in the code we're logging elapsed time. I think we'll need to add the new timer to this chart or make a new chart entirely on the same dashboard.

Testing

I was able to test this by swapping out the QueuingMetricSync here with a SpyMetricSync that prints to a file like so:

let file = File::create("foo.txt")?;
let spy = SpyMetricSink::from(Arc::new(Mutex::new(file)));
StatsdClient::builder(opts.statsd_label.as_ref(), spy)

The metrics that would have been sent to sentry were logged to a file named "foo.txt", and I was able to confirm that the metric I added worked as expected. I included a commit (b658de0) on this branch with these changes so the reviewer can try it out themselves.

I didn't see unit tests for the metrics logging, so I didn't add one for this change, but it's totally possible I just couldn't find them!

Issue(s)

Closes #952

@ethowitz ethowitz requested a review from a team April 14, 2021 21:25
@ethowitz ethowitz merged commit 57bd30a into master Apr 15, 2021
@ethowitz ethowitz deleted the refactor/952-add-metric-for-spanner-pool-get branch April 15, 2021 16:46
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.

Emit metric for spanner DbPool::get time taken
2 participants