-
Couldn't load subscription status.
- Fork 87
PMM-4145 Add RDS disable metric collection. #41
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
| continue | ||
| } | ||
| instance := instance | ||
| wg.Add(1) |
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.
only cuddled expressions if assigning variable or using from line above (from wsl)
Codecov Report
@@ Coverage Diff @@
## master #41 +/- ##
==========================================
+ Coverage 81.64% 81.89% +0.24%
==========================================
Files 9 9
Lines 741 751 +10
==========================================
+ Hits 605 615 +10
Misses 118 118
Partials 18 18
Continue to review full report at Codecov.
|
| assert.Equal(t, expectedMetrics, actualMetrics) | ||
| } | ||
|
|
||
| func TestCollectorDisableBasicMetrics(t *testing.T) { |
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.
func TestCollectorDisableBasicMetrics is unused (from unused)
| func TestCollectorDisableBasicMetrics(t *testing.T) { | ||
| cfg, err := config.Load("../config.tests.yml") | ||
| require.NoError(t, err) | ||
| client := client.New() |
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.
assignments should only be cuddled with other assignments (from wsl)
| cfg, err := config.Load("../config.tests.yml") | ||
| require.NoError(t, err) | ||
| client := client.New() | ||
| for i := range cfg.Instances { |
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.
only one cuddle assignment allowed before range statement (from wsl)
| for i := range cfg.Instances { | ||
| cfg.Instances[i].DisableBasicMetrics = true | ||
| } | ||
| sess, err := sessions.New(cfg.Instances, client.HTTP(), false) |
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.
assignments should only be cuddled with other assignments (from wsl)
basic/collector_test.go
Outdated
|
|
||
| actualMetrics := helpers.ReadMetrics(helpers.CollectMetrics(c)) | ||
| actualLines := helpers.Format(helpers.WriteMetrics(actualMetrics)) | ||
| for _, line := range actualLines { |
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.
only one cuddle assignment allowed before range statement (from wsl)
basic/collector_test.go
Outdated
| assert.Falsef( | ||
| t, | ||
| strings.Contains(inst.Instance, line), | ||
| "Instance %s with disabled metrics reseive: %s", |
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.
receive?
basic/collector_test.go
Outdated
| require.NoError(t, err) | ||
| client := client.New() | ||
| for i := range cfg.Instances { | ||
| cfg.Instances[i].DisableBasicMetrics = true |
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.
let's disable only part of our instances to check that tests work.
| return true | ||
| } | ||
| } | ||
| return false |
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.
return statements should not be cuddled if block has more than two lines (from wsl)
basic/collector_test.go
Outdated
| instanceGroups := make(map[bool][]string, 2) | ||
| for i := range cfg.Instances { | ||
| // Disable basic metrics in odd instances. | ||
| isDisabled := i%2 == 1 |
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.
mnd: Magic number: 2, in detected (from gomnd)
| for i := range cfg.Instances { | ||
| // Disable basic metrics in even instances. | ||
| // This disable instance: no-such-instance. | ||
| isDisabled := i%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.
mnd: Magic number: 2, in detected (from gomnd)
| } | ||
| } | ||
|
|
||
| func TestScraperDisableEnhancedMetrics(t *testing.T) { |
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.
func TestScraperDisableEnhancedMetrics is unused (from unused)
| func TestScraperDisableEnhancedMetrics(t *testing.T) { | ||
| cfg, err := config.Load("../config.tests.yml") | ||
| require.NoError(t, err) | ||
| client := client.New() |
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.
assignments should only be cuddled with other assignments (from wsl)
| cfg, err := config.Load("../config.tests.yml") | ||
| require.NoError(t, err) | ||
| client := client.New() | ||
| for i := range cfg.Instances { |
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.
only one cuddle assignment allowed before range statement (from wsl)
| return true | ||
| } | ||
| } | ||
| return false |
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.
return statements should not be cuddled if block has more than two lines (from wsl)
| for i := range cfg.Instances { | ||
| // Disable enhanced metrics in even instances. | ||
| // This disable instance: no-such-instance. | ||
| isDisabled := i%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.
mnd: Magic number: 2, in detected (from gomnd)
https://jira.percona.com/browse/PMM-4145
Ref:
FB: