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

JavaDoc TaggedMetricRegistry API #69

Merged
merged 1 commit into from
Dec 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,28 @@ public static TaggedMetricRegistry getDefault() {
}

@Override
public Counter counter(MetricName metric) {
return getOrAdd(metric, Counter.class, Counter::new);
public Counter counter(MetricName metricName) {
return getOrAdd(metricName, Counter.class, Counter::new);
}

@Override
public Gauge gauge(MetricName metric, Gauge gauge) {
return getOrAdd(metric, Gauge.class, () -> gauge);
public Gauge gauge(MetricName metricName, Gauge gauge) {
return getOrAdd(metricName, Gauge.class, () -> gauge);
}

@Override
public Histogram histogram(MetricName metric) {
return getOrAdd(metric, Histogram.class, () -> new Histogram(new ExponentiallyDecayingReservoir()));
public Histogram histogram(MetricName metricName) {
return getOrAdd(metricName, Histogram.class, () -> new Histogram(new ExponentiallyDecayingReservoir()));
}

@Override
public Meter meter(MetricName metric) {
return getOrAdd(metric, Meter.class, Meter::new);
public Meter meter(MetricName metricName) {
return getOrAdd(metricName, Meter.class, Meter::new);
}

@Override
public Timer timer(MetricName metric) {
return getOrAdd(metric, Timer.class, Timer::new);
public Timer timer(MetricName metricName) {
return getOrAdd(metricName, Timer.class, Timer::new);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,52 @@
*/
public interface TaggedMetricRegistry {

Timer timer(MetricName metric);
/**
* Returns existing or new timer metric for the specified metric name.
*
* @param metricName metric name
* @return timer metric
*/
Timer timer(MetricName metricName);

Meter meter(MetricName metric);
/**
* Returns existing or new meter metric for the specified metric name.
*
* @param metricName metric name
* @return meter metric
*/
Meter meter(MetricName metricName);

Histogram histogram(MetricName metric);
/**
* Returns existing or new histogram metric for the specified metric name.
*
* @param metricName metric name
* @return histogram metric
*/
Histogram histogram(MetricName metricName);

/**
* Returns existing or new gauge metric for the specified metric name.
*
* @param metricName metric name
* @param gauge gauge
* @return gauge metric
*/
// This differs from MetricRegistry and takes the Gauge directly rather than a Supplier<Gauge>
Gauge gauge(MetricName metric, Gauge gauge);
Gauge gauge(MetricName metricName, Gauge gauge);

Counter counter(MetricName metric);
/**
* Returns existing or new counter metric for the specified metric name.
*
* @param metricName metric name
* @return counter metric
*/
Counter counter(MetricName metricName);

/**
* Returns a map of registered metrics.
*
* @return map of registered metrics
*/
Map<MetricName, Metric> getMetrics();
}