Class DoubleCounter
- java.lang.Object
-
- org.kairosdb.metrics4j.collectors.impl.DoubleCounter
-
- All Implemented Interfaces:
Serializable,Collector,DoubleCollector,MetricCollector,PostConstruct
public class DoubleCounter extends Object implements DoubleCollector
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected doublem_countprotected Objectm_counterLockprotected booleanreportZeroprotected booleanreset
-
Constructor Summary
Constructors Constructor Description DoubleCounter()DoubleCounter(boolean reset, boolean reportZero)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collectorclone()The first instance of a collector is unmarshalled from configuration using hocon, all other instances are cloned from that first one so the clone method should pass along any configuration that was set.voidinit(MetricsContext context)voidput(double value)Place a double value into the collector to be reported.voidput(Instant time, double value)Place a double value and associated timestamp into the collector to be reported.voidreportMetric(MetricReporter metricReporter)voidsetContextProperties(Map<String,String> contextProperties)
-
-
-
Field Detail
-
m_count
protected double m_count
-
m_counterLock
protected Object m_counterLock
-
reset
protected boolean reset
-
reportZero
protected boolean reportZero
-
-
Method Detail
-
put
public void put(double value)
Description copied from interface:DoubleCollectorPlace a double value into the collector to be reported. The actual value reported is determined by the collector implementation that is configured for this source.- Specified by:
putin interfaceDoubleCollector- Parameters:
value- Value to be reported.
-
put
public void put(Instant time, double value)
Description copied from interface:DoubleCollectorPlace a double value and associated timestamp into the collector to be reported. The actual value and time reported is determined by the collector implementation that is configured for this source.- Specified by:
putin interfaceDoubleCollector- Parameters:
time- Suggested timestamp to use when reporting.value- Value to be reported.
-
clone
public Collector clone()
Description copied from interface:CollectorThe first instance of a collector is unmarshalled from configuration using hocon, all other instances are cloned from that first one so the clone method should pass along any configuration that was set.
-
init
public void init(MetricsContext context)
- Specified by:
initin interfacePostConstruct
-
reportMetric
public void reportMetric(MetricReporter metricReporter)
- Specified by:
reportMetricin interfaceMetricCollector
-
setContextProperties
public void setContextProperties(Map<String,String> contextProperties)
- Specified by:
setContextPropertiesin interfaceMetricCollector
-
-