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