Package org.nuxeo.runtime.metrics
Class NuxeoMetricSet
- java.lang.Object
-
- org.nuxeo.runtime.metrics.NuxeoMetricSet
-
- All Implemented Interfaces:
io.dropwizard.metrics5.Metric
,io.dropwizard.metrics5.MetricSet
- Direct Known Subclasses:
GuavaCacheMetric
public class NuxeoMetricSet extends Object implements io.dropwizard.metrics5.MetricSet
Just a helper to easily declare metrics inside aMetricSet
with th ease of Java 8 Lambda expression.- Since:
- 8.10-HF08, 9.2
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Metric>
metrics
protected io.dropwizard.metrics5.MetricName
prefixName
-
Constructor Summary
Constructors Constructor Description NuxeoMetricSet()
NuxeoMetricSet(io.dropwizard.metrics5.MetricName name)
NuxeoMetricSet(String name, String... names)
NuxeoMetricSet(Supplier<Map<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Metric>> metricsSupplier, io.dropwizard.metrics5.MetricName name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<io.dropwizard.metrics5.MetricName>
getMetricNames()
Map<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Metric>
getMetrics()
io.dropwizard.metrics5.MetricName
getPrefixName()
<T> void
putGauge(io.dropwizard.metrics5.Gauge<T> gauge, io.dropwizard.metrics5.MetricName name)
Put a gauge inside thisMetricSet
as nameprefixName.name.names[0].names[1]...
;<T> void
putGauge(io.dropwizard.metrics5.Gauge<T> gauge, String name, String... names)
-
-
-
Field Detail
-
metrics
protected final Map<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Metric> metrics
-
prefixName
protected final io.dropwizard.metrics5.MetricName prefixName
-
-
Method Detail
-
putGauge
public <T> void putGauge(io.dropwizard.metrics5.Gauge<T> gauge, io.dropwizard.metrics5.MetricName name)
Put a gauge inside thisMetricSet
as nameprefixName.name.names[0].names[1]...
;
-
putGauge
public <T> void putGauge(io.dropwizard.metrics5.Gauge<T> gauge, String name, String... names)
-
getMetrics
public Map<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Metric> getMetrics()
- Specified by:
getMetrics
in interfaceio.dropwizard.metrics5.MetricSet
-
getPrefixName
public io.dropwizard.metrics5.MetricName getPrefixName()
- Returns:
- the prefix name used by this
MetricSet
to prefix all added metrics, the value could be empty
-
getMetricNames
public Set<io.dropwizard.metrics5.MetricName> getMetricNames()
- Returns:
- all metric names registered into this
MetricSet
-
-