public abstract class Collector extends Object
Normal users should use Gauge, Counter and Summary.
Subclasssing Collector is for advanced uses, such as proxying metrics from another monitoring system. It is it the responsibility of subclasses to ensure they produce valid metrics.
| Modifier and Type | Class and Description |
|---|---|
static class |
Collector.MetricFamilySamples
A metric, and all of it's samples.
|
static class |
Collector.Type |
| Modifier and Type | Field and Description |
|---|---|
protected static Pattern |
METRIC_LABEL_NAME_RE |
protected static Pattern |
METRIC_NAME_RE |
static double |
MILLISECONDS_PER_SECOND
Number of milliseconds in a second.
|
static double |
NANOSECONDS_PER_SECOND
Number of nanoseconds in a second.
|
protected static Pattern |
RESERVED_METRIC_LABEL_NAME_RE |
| Constructor and Description |
|---|
Collector() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkMetricLabelName(String name)
Throw an exception if the metric label name is invalid.
|
protected static void |
checkMetricName(String name)
Throw an exception if the metric name is invalid.
|
abstract List<Collector.MetricFamilySamples> |
collect()
Return all of the metrics of this Collector.
|
static String |
doubleToGoString(double d)
Convert a double to it's string representation in Go.
|
<T extends Collector> |
register()
Register the Collector with the default registry.
|
<T extends Collector> |
register(CollectorRegistry registry)
Register the Collector with the given registry.
|
public static final double NANOSECONDS_PER_SECOND
public static final double MILLISECONDS_PER_SECOND
protected static final Pattern METRIC_NAME_RE
protected static final Pattern METRIC_LABEL_NAME_RE
protected static final Pattern RESERVED_METRIC_LABEL_NAME_RE
public abstract List<Collector.MetricFamilySamples> collect()
public <T extends Collector> T register()
public <T extends Collector> T register(CollectorRegistry registry)
protected static void checkMetricName(String name)
protected static void checkMetricLabelName(String name)
public static String doubleToGoString(double d)
Copyright © 2015. All rights reserved.