Class DropwizardMetricServices
- java.lang.Object
- org.springframework.boot.actuate.metrics.dropwizard.DropwizardMetricServices
- All Implemented Interfaces:
CounterService
,GaugeService
public class DropwizardMetricServices extends Object implements CounterService, GaugeService
AGaugeService
andCounterService
that sends data to a DropwizardMetricRegistry
based on a naming convention.- Updates to
increment(String)
with names in "meter.*" are treated asMeter
events - Other deltas are treated as simple
Counter
values - Inputs to
submit(String, double)
with names in "histogram.*" are treated asHistogram
updates - Inputs to
submit(String, double)
with names in "timer.*" are treated asTimer
updates - Other metrics are treated as simple
Gauge
values (single valued measurements of type double)
Constructor Summary
Constructors Constructor Description DropwizardMetricServices(com.codahale.metrics.MetricRegistry registry)
Create a newDropwizardMetricServices
instance.DropwizardMetricServices(com.codahale.metrics.MetricRegistry registry, ReservoirFactory reservoirFactory)
Create a newDropwizardMetricServices
instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decrement(String name)
Decrement the specified counter by 1.void
increment(String name)
Increment the specified counter by 1.void
reset(String name)
Reset the specified counter.void
submit(String name, double value)
Set the specified gauge value.
Constructor Detail
DropwizardMetricServices
public DropwizardMetricServices(com.codahale.metrics.MetricRegistry registry)
Create a newDropwizardMetricServices
instance.- Parameters:
registry
- the underlying metric registry
DropwizardMetricServices
public DropwizardMetricServices(com.codahale.metrics.MetricRegistry registry, ReservoirFactory reservoirFactory)
Create a newDropwizardMetricServices
instance.- Parameters:
registry
- the underlying metric registryreservoirFactory
- the factory that instantiates theReservoir
that will be used on Timers and Histograms
Method Detail
increment
public void increment(String name)
Description copied from interface:CounterService
Increment the specified counter by 1.- Specified by:
increment
in interfaceCounterService
- Parameters:
name
- the name of the counter
decrement
public void decrement(String name)
Description copied from interface:CounterService
Decrement the specified counter by 1.- Specified by:
decrement
in interfaceCounterService
- Parameters:
name
- the name of the counter
submit
public void submit(String name, double value)
Description copied from interface:GaugeService
Set the specified gauge value.- Specified by:
submit
in interfaceGaugeService
- Parameters:
name
- the name of the gauge to setvalue
- the value of the gauge
reset
public void reset(String name)
Description copied from interface:CounterService
Reset the specified counter.- Specified by:
reset
in interfaceCounterService
- Parameters:
name
- the name of the counter