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

Add SettableGauge interface and an implementation #1607

Closed

Conversation

xiaochuanyu
Copy link

This PR was re-made from #1599 to change source (and target branch).

This PR attempts to address #1126.

Example usage:

MetricRegistry registry = new MetricRegistry();
SettableGauge<Integer> settable = registry.register("example1", new SimpleSettableGauge<>(0));
settable.setValue(123);

@xiaochuanyu
Copy link
Author

@joschi I've made this new PR to target release/4.2.x per your comment from the original PR.

@the-thing I've addressed the comments from the original PR in 9fe9105 here.

Copy link
Contributor

@the-thing the-thing left a comment

Choose a reason for hiding this comment

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

LGTM. The name of the default implementation might not suit some people, because the existing naming convention favours "Default" prefix such as com.codahale.metrics.jdbi3.strategies.DefaultNameStrategy or com.codahale.metrics.jmx.DefaultObjectNameFactory.

joschi added a commit that referenced this pull request Jan 2, 2021
@joschi
Copy link
Member

joschi commented Jan 2, 2021

Merged in f4d84b6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generify MetricRegistry.gauge()
3 participants