-
Notifications
You must be signed in to change notification settings - Fork 186
PMM-9630 Use status, status_code only for some versions. #912
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
Conversation
| // String returns a string representation of this struct or record. | ||
| func (s pgStatMonitor) String() string { | ||
| res := make([]string, 51) | ||
| res := make([]string, 49) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci-lint] reported by reviewdog 🐶
mnd: Magic number: 49, in detected (gomnd)
Codecov Report
@@ Coverage Diff @@
## main #912 +/- ##
==========================================
- Coverage 45.05% 45.04% -0.02%
==========================================
Files 326 326
Lines 39147 39160 +13
==========================================
Hits 17639 17639
- Misses 19958 19972 +14
+ Partials 1550 1549 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| pgStatMonitorVersion10PG12 | ||
| pgStatMonitorVersion10PG13 | ||
| pgStatMonitorVersion10PG14 | ||
| pgStatMonitorVersion11PG12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci-lint] reported by reviewdog 🐶pgStatMonitorVersion11PG12 is unused (deadcode)
| pgStatMonitorVersion10PG13 | ||
| pgStatMonitorVersion10PG14 | ||
| pgStatMonitorVersion11PG12 | ||
| pgStatMonitorVersion11PG13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci-lint] reported by reviewdog 🐶pgStatMonitorVersion11PG13 is unused (deadcode)
| pgStatMonitorVersion10PG12 | ||
| pgStatMonitorVersion10PG13 | ||
| pgStatMonitorVersion10PG14 | ||
| pgStatMonitorVersion11PG12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new variables are not added to this function https://github.com/percona/pmm/pull/912/files#diff-ae12be77883993fc7d2b5ebc501e2fb0b0078ea1d4645c2f9327095ae0661d30R153
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
| conditions := "WHERE queryid IS NOT NULL AND query IS NOT NULL" | ||
| if pgMonitorVersion >= pgStatMonitorVersion09 { | ||
| // only pg_stat_monitor 0.9.0 and above supports state_code. It tells what is the query's current state. | ||
| if pgMonitorVersion >= pgStatMonitorVersion09 && pgMonitorVersion <= pgStatMonitorVersion11PG14 && prerelease != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that we decided to have a check like version >= 0.9 and version <= 2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
PMM-9630
Original PR: percona/pmm-agent#327
Build: SUBMODULES-0