Skip to content

Conversation

@percona-csalguero
Copy link
Contributor

@percona-csalguero percona-csalguero commented Aug 25, 2021

PMM-7424 Add dbStats-based metric to mongodb_exporter v0.20+
This is a draft PR to be able to create a feature build for a 3rd party contribution.
DO NOT MERGE

Feature buiild: pmm-submodules PR #1982

"github.com/percona/mongodb_exporter/internal/tu"
)

func TestDBStatsCollector(t *testing.T) {

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 🐶
Function 'TestDBStatsCollector' is too long (77 > 60) (funlen)


ti := labelsGetterMock{}

c := &dbstatsCollector{

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 🐶
ctx, compatibleMode are missing in dbstatsCollector (exhaustivestruct)

dbNames, err := d.client.ListDatabaseNames(d.ctx, bson.M{})
if err != nil {
d.logger.Errorf("Failed to get database names: %s", err)
return

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 🐶
return with no blank line before (nlreturn)

err := r.Decode(&dbStats)
if err != nil {
d.logger.Errorf("Failed to get $dbstats for database %s: %s", db, err)
continue

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 🐶
continue with no blank line before (nlreturn)

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