-
Notifications
You must be signed in to change notification settings - Fork 188
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
Change Integer Counter type from AtomicI64 to AtomicU64 #365
Conversation
Signed-off-by: Folyd <[email protected]>
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 am in favor of this change. Thanks.
I find the name IntCounter a bit confusing, as my intuition would include negative numbers as well, which (rightly so) doesn't make any sense for a Prometheus counter. I am failing to come up with a better name.
While already enforced through the type system, I suggest to make the following changes to the type signature comments to emphasize the fact that one can only to pass natural numbers.
Signed-off-by: Folyd <[email protected]>
It might be useful to also document (not sure where's best, maybe along with the "better performance" notes?), that these integer counters will wrap with Not sure if that's in scope for this PR tho'. |
I am in favor of this, but as you said, I think it is out of scope for this pull request. @tim-seoss would you mind opening up a new pull request doing the suggested changes? |
Unless there are any objections I will merge this pull request later today. |
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.
Thank you!
According to the definition of Prometheus's Counter type, the
AtomicU64
is preferred toAtomicI64
forIntCounter*
types:Fix #364 .