APIMetrics: Creating an APIHistogram instead of Histogram

This change accept a URL for the histogram creation methods and passing
it to the default registry so the created histogram will be the
APIHistogram instead of Histogram.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
Amnon Heiman 2015-06-18 11:40:22 +03:00
parent a600152de7
commit d1f85080b4

View File

@ -144,9 +144,9 @@ public class APIMetrics {
* whether or not the histogram should be biased * whether or not the histogram should be biased
* @return a new {@link com.yammer.metrics.core.Histogram} * @return a new {@link com.yammer.metrics.core.Histogram}
*/ */
public static Histogram newHistogram(Class<?> klass, String name, public static Histogram newHistogram(String url, Class<?> klass,
boolean biased) { String name, boolean biased) {
return DEFAULT_REGISTRY.newHistogram(klass, name, biased); return DEFAULT_REGISTRY.newHistogram(url, klass, name, biased);
} }
/** /**
@ -163,9 +163,9 @@ public class APIMetrics {
* whether or not the histogram should be biased * whether or not the histogram should be biased
* @return a new {@link com.yammer.metrics.core.Histogram} * @return a new {@link com.yammer.metrics.core.Histogram}
*/ */
public static Histogram newHistogram(Class<?> klass, String name, public static Histogram newHistogram(String url, Class<?> klass,
String scope, boolean biased) { String name, String scope, boolean biased) {
return DEFAULT_REGISTRY.newHistogram(klass, name, scope, biased); return DEFAULT_REGISTRY.newHistogram(url, klass, name, scope, biased);
} }
/** /**
@ -178,8 +178,9 @@ public class APIMetrics {
* whether or not the histogram should be biased * whether or not the histogram should be biased
* @return a new {@link com.yammer.metrics.core.Histogram} * @return a new {@link com.yammer.metrics.core.Histogram}
*/ */
public static Histogram newHistogram(MetricName metricName, boolean biased) { public static Histogram newHistogram(String url, MetricName metricName,
return DEFAULT_REGISTRY.newHistogram(metricName, biased); boolean biased) {
return DEFAULT_REGISTRY.newHistogram(url, metricName, biased);
} }
/** /**
@ -192,8 +193,8 @@ public class APIMetrics {
* the name of the metric * the name of the metric
* @return a new {@link com.yammer.metrics.core.Histogram} * @return a new {@link com.yammer.metrics.core.Histogram}
*/ */
public static Histogram newHistogram(Class<?> klass, String name) { public static Histogram newHistogram(String url, Class<?> klass, String name) {
return DEFAULT_REGISTRY.newHistogram(klass, name); return DEFAULT_REGISTRY.newHistogram(url, klass, name);
} }
/** /**
@ -208,9 +209,9 @@ public class APIMetrics {
* the scope of the metric * the scope of the metric
* @return a new {@link com.yammer.metrics.core.Histogram} * @return a new {@link com.yammer.metrics.core.Histogram}
*/ */
public static Histogram newHistogram(Class<?> klass, String name, public static Histogram newHistogram(String url, Class<?> klass,
String scope) { String name, String scope) {
return DEFAULT_REGISTRY.newHistogram(klass, name, scope); return DEFAULT_REGISTRY.newHistogram(url, klass, name, scope);
} }
/** /**
@ -221,8 +222,8 @@ public class APIMetrics {
* the name of the metric * the name of the metric
* @return a new {@link com.yammer.metrics.core.Histogram} * @return a new {@link com.yammer.metrics.core.Histogram}
*/ */
public static Histogram newHistogram(MetricName metricName) { public static Histogram newHistogram(String url, MetricName metricName) {
return newHistogram(metricName, false); return newHistogram(url, metricName, false);
} }
/** /**