Refactor/952 add metric for spanner pool get #1044
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 aSpyMetricSync
that prints to a file like so: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