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

Azure Metrics: fix getFirstMetricValue to return the first value #648

Merged
merged 3 commits into from
Dec 4, 2024

Conversation

keiko713
Copy link
Contributor

@keiko713 keiko713 commented Dec 3, 2024

Spotted by Maciek in https://github.com/pganalyze/collector/pull/591/files#r1866387023

This function was previously returning the last value instead of the first value. This fix changes it and returns the value as soon as reading it.

Tested with the staging Azure database and it didn't break things.

This function was previously returning the last value instead of the
first value. This fix changes it and returns the value as soon as
reading it.
@keiko713 keiko713 requested review from msakrejda and a team December 3, 2024 07:23
Copy link
Contributor

@msakrejda msakrejda left a comment

Choose a reason for hiding this comment

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

I find the loops a little puzzling: I'm wondering if I'm missing something and we can't just do an array index lookup. But either works.

input/system/azure/system.go Outdated Show resolved Hide resolved
@keiko713 keiko713 merged commit a32fd47 into main Dec 4, 2024
3 checks passed
@keiko713 keiko713 deleted the azure-actually-get-first-metric branch December 4, 2024 05:50
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