Skip to content

Raise an exception on negative arguments passed to Counter.add #3

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

Open
tibbe opened this issue Oct 20, 2014 · 2 comments
Open

Raise an exception on negative arguments passed to Counter.add #3

tibbe opened this issue Oct 20, 2014 · 2 comments

Comments

@tibbe
Copy link
Collaborator

tibbe commented Oct 20, 2014

To partly address #2 we should raise an exception if someone passes a negative argument to Counter.add.

@seanparsons
Copy link
Contributor

Somewhat playing devils advocate should counters always be increasing or is that just for RRD support? I'm using something similar for an inflight request count, incrementing at the start and decrementing on completion, otherwise something like that would have to be a gauge and somewhat manual.

@tibbe
Copy link
Collaborator Author

tibbe commented Apr 7, 2015

The main reason is that if you're guaranteed that a counter is non-decreasing, you can detect when a process you're monitoring crashes (because the counter would go backwards) and correct for it.

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

No branches or pull requests

2 participants