Skip to content

Conversation

@JiriCtvrtka
Copy link
Contributor

PMM-9630

Original PR: percona/pmm-agent#327

Build: SUBMODULES-0

  • Links to other linked pull requests (optional).

// String returns a string representation of this struct or record.
func (s pgStatMonitor) String() string {
res := make([]string, 51)
res := make([]string, 49)
Copy link
Contributor

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
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Merging #912 (8292912) into main (3bd0c34) will decrease coverage by 0.01%.
The diff coverage is 19.04%.

@@            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     
Flag Coverage Δ
agent 53.80% <19.04%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ent/agents/postgres/pgstatmonitor/pgstatmonitor.go 13.30% <0.00%> (-0.55%) ⬇️
...nts/postgres/pgstatmonitor/pgstatmonitor_models.go 57.22% <50.00%> (+0.15%) ⬆️
...gents/postgres/pgstatmonitor/stat_monitor_cache.go 45.93% <100.00%> (+0.31%) ⬆️
agent/agents/mysql/slowlog/slowlog.go 48.29% <0.00%> (-2.98%) ⬇️
agent/runner/runner.go 81.43% <0.00%> (+8.98%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@JiriCtvrtka JiriCtvrtka marked this pull request as ready for review August 16, 2022 07:15
pgStatMonitorVersion10PG12
pgStatMonitorVersion10PG13
pgStatMonitorVersion10PG14
pgStatMonitorVersion11PG12
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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 != "" {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

@JiriCtvrtka JiriCtvrtka requested a review from BupycHuk August 26, 2022 08:57
@JiriCtvrtka JiriCtvrtka merged commit 83144bf into main Aug 26, 2022
@JiriCtvrtka JiriCtvrtka deleted the PMM-9630-status-code-usage branch August 26, 2022 09:53
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.

4 participants