Class DefaultCounterService
- java.lang.Object
- org.springframework.boot.actuate.metrics.writer.DefaultCounterService
- All Implemented Interfaces:
CounterService
public class DefaultCounterService extends Object implements CounterService
Default implementation ofCounterService
.
Constructor Summary
Constructors Constructor Description DefaultCounterService(MetricWriter writer)
Create aDefaultCounterService
instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decrement(String metricName)
Decrement the specified counter by 1.void
increment(String metricName)
Increment the specified counter by 1.void
reset(String metricName)
Reset the specified counter.
Constructor Detail
DefaultCounterService
public DefaultCounterService(MetricWriter writer)
Create aDefaultCounterService
instance.- Parameters:
writer
- the underlying writer used to manage metrics
Method Detail
increment
public void increment(String metricName)
Description copied from interface:CounterService
Increment the specified counter by 1.- Specified by:
increment
in interfaceCounterService
- Parameters:
metricName
- the name of the counter
decrement
public void decrement(String metricName)
Description copied from interface:CounterService
Decrement the specified counter by 1.- Specified by:
decrement
in interfaceCounterService
- Parameters:
metricName
- the name of the counter
reset
public void reset(String metricName)
Description copied from interface:CounterService
Reset the specified counter.- Specified by:
reset
in interfaceCounterService
- Parameters:
metricName
- the name of the counter