Skip to content
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

Feature: implement the volatile counter #933

Closed
Tracked by #922
empiredan opened this issue Mar 28, 2022 · 0 comments
Closed
Tracked by #922

Feature: implement the volatile counter #933

empiredan opened this issue Mar 28, 2022 · 0 comments
Labels
type/enhancement Indicates new feature requests

Comments

@empiredan
Copy link
Contributor

empiredan commented Mar 28, 2022

In #931 we've implemented the counter, a type of metric. However, a counter can be volatile, whose value() function will reset the counter atomically after its value is fetched. A volatile counter can also be called as a "recent" counter.

Sometimes "recent" counters are needed, such as the number of recent failed beacons sent from replica server, the count of updating configurations of partitions recently, etc. The "recent" can be considered to be the accumulated count since it has been fetched last.

In most cases, a general (i.e. non-volatile) counter is enough, which means it can also work for "recent" counters. For example, in Prometheus, delta() can be used to compute "recent" count for a general counter. Therefore, declare a counter as volatile only when necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Indicates new feature requests
Projects
None yet
Development

No branches or pull requests

1 participant