Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

stats: add config to disable count per bucket #52

Merged
merged 8 commits into from
Sep 26, 2019

Conversation

AlexandreYang
Copy link
Member

Description

Add config to disable count per bucket

Motivation

Initial request:

This PR also adds an option to disable emitting Counts Per Buckets which for us is not useful and is quite expensive due to the number of tags that are emitted.

#41

@AlexandreYang AlexandreYang force-pushed the alex/vendasta/disable-count-per-bucket branch from 194eaaf to b02c899 Compare September 25, 2019 16:42
@gbbr gbbr changed the title Add config to disable count per bucket stats: add config to disable count per bucket Sep 26, 2019
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Mostly looks good, but left some comments on tests.

stats_test.go Outdated Show resolved Hide resolved
stats_test.go Outdated Show resolved Hide resolved
stats_test.go Outdated Show resolved Hide resolved
stats_test.go Outdated Show resolved Hide resolved
stats_test.go Outdated Show resolved Hide resolved
stats_test.go Outdated Show resolved Hide resolved
stats_test.go Outdated Show resolved Hide resolved
@AlexandreYang AlexandreYang force-pushed the alex/vendasta/disable-count-per-bucket branch from d0a224b to 78d78bd Compare September 26, 2019 08:02
@AlexandreYang AlexandreYang force-pushed the alex/vendasta/disable-count-per-bucket branch from 78d78bd to cd42213 Compare September 26, 2019 08:02
@AlexandreYang AlexandreYang changed the title stats: add config to disable count per bucket [HOLD] stats: add config to disable count per bucket Sep 26, 2019
@AlexandreYang AlexandreYang changed the title [HOLD] stats: add config to disable count per bucket stats: add config to disable count per bucket Sep 26, 2019
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Thanks Alexandre! Unfortunately you have still not addressed all comments. What I recommend doing is to take each comment one by one, address it, and after you do so, reply to them and mark them as resolved.

If you don't agree with some of the comments, that's also ok, but please reply on each one of them.

@AlexandreYang
Copy link
Member Author

Thanks for the quick feedback. Just made another update. Let me know if that's ok for you.

Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your patience! Left one more comment.

Also, I'd suggest not resolving a comment on which we haven't yet reached a consensus (common ground). When a comment is resolved it generally means that we both agreed on the outcome, whereas some comments (like the test renaming), are still open for discussion.

stats_test.go Outdated
}
})

t.Run("count per buckets disabled", func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

For the same reason as stated in #52 (comment), the general pattern is to use one or two words max. I think in this case it is obvious that one tests verifies the feature and the other verifies that it can be disabled. So I suggest, either:

  • on and off
  • enabled or disabled
  • ok and off
  • ok or disabled

I think it is clear enough. Adding sentences and more words makes the tests look ugly when running.

Copy link
Member Author

@AlexandreYang AlexandreYang Sep 26, 2019

Choose a reason for hiding this comment

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

Sure. Make sense. Replaced by disabled.

I also refactored to use a map of testCases to reduce duplication. See my last commit.

@AlexandreYang AlexandreYang force-pushed the alex/vendasta/disable-count-per-bucket branch from c081f42 to 3a2bdb3 Compare September 26, 2019 12:50
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Awesome!

@gbbr gbbr merged commit fe3fae7 into master Sep 26, 2019
@gbbr gbbr deleted the alex/vendasta/disable-count-per-bucket branch September 26, 2019 13:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants