Class PutCounter
- java.lang.Object
-
- org.kairosdb.metrics4j.collectors.helpers.TimerCollector
-
- org.kairosdb.metrics4j.collectors.impl.PutCounter
-
- All Implemented Interfaces:
Serializable,Collector,DoubleCollector,DurationCollector,LongCollector,MetricCollector,StringCollector,TimeCollector,PostConstruct
public class PutCounter extends TimerCollector implements LongCollector, DoubleCollector, StringCollector, DurationCollector, TimeCollector, MetricCollector
Counts the number of times put is called to pass on a metric.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.kairosdb.metrics4j.collectors.helpers.TimerCollector
TimerCollector.ReportFormat
-
Nested classes/interfaces inherited from interface org.kairosdb.metrics4j.collectors.DurationCollector
DurationCollector.TimeCallable<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected AtomicLongm_countprotected booleanreportZeroprotected booleanreset-
Fields inherited from class org.kairosdb.metrics4j.collectors.helpers.TimerCollector
m_timeReporter
-
-
Constructor Summary
Constructors Constructor Description PutCounter()PutCounter(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(long count)Place a long value into the collector to be reported.voidput(String value)Place a String value into the collector to be reported.voidput(Duration duration)Place a Duration value into the collector to be reported.voidput(Instant time)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.voidput(Instant time, long value)Place a long value and associated timestamp into the collector to be reported.voidput(Instant time, String value)Place a double value and associated timestamp into the collector to be reported.voidput(Instant time, Duration duration)Place a Duration value and associated timestamp into the collector to be reported.voidput(Instant time, Instant value)Place a double value and associated timestamp into the collector to be reported.voidreportMetric(MetricReporter metricReporter)-
Methods inherited from class org.kairosdb.metrics4j.collectors.helpers.TimerCollector
getReportFormat, getReportUnit, setContextProperties, setReportFormat, setReportUnit, time, time, timeEx
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.kairosdb.metrics4j.collectors.DurationCollector
time, time, timeEx
-
Methods inherited from interface org.kairosdb.metrics4j.collectors.MetricCollector
setContextProperties
-
-
-
-
Field Detail
-
m_count
protected final AtomicLong m_count
-
reset
protected boolean reset
-
reportZero
protected boolean reportZero
-
-
Method Detail
-
put
public void put(long count)
Description copied from interface:LongCollectorPlace a long 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 interfaceLongCollector- Parameters:
count- Value to be reported.
-
put
public void put(Instant time, long value)
Description copied from interface:LongCollectorPlace a long 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 interfaceLongCollector- Parameters:
time- Suggested timestamp to use when reporting.value- Value to be reported.
-
reportMetric
public void reportMetric(MetricReporter metricReporter)
- Specified by:
reportMetricin interfaceMetricCollector
-
init
public void init(MetricsContext context)
- Specified by:
initin interfacePostConstruct
-
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.- Specified by:
clonein interfaceCollector- Specified by:
clonein classTimerCollector- Returns:
- Clone of this collector
-
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.
-
put
public void put(Duration duration)
Description copied from interface:DurationCollectorPlace a Duration 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 interfaceDurationCollector- Parameters:
duration- Value to be reported.
-
put
public void put(Instant time, Duration duration)
Description copied from interface:DurationCollectorPlace a Duration 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 interfaceDurationCollector- Parameters:
time- Suggested timestamp to use when reporting.duration- Value to be reported.
-
put
public void put(String value)
Description copied from interface:StringCollectorPlace a String 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 interfaceStringCollector- Parameters:
value- Value to be reported.
-
put
public void put(Instant time, String value)
Description copied from interface:StringCollectorPlace 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 interfaceStringCollector- Parameters:
time- Suggested timestamp to use when reporting.value- Value to be reported.
-
put
public void put(Instant time)
Description copied from interface:TimeCollectorPlace 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 interfaceTimeCollector- Parameters:
time- Value to be reported.
-
put
public void put(Instant time, Instant value)
Description copied from interface:TimeCollectorPlace 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 interfaceTimeCollector- Parameters:
time- Suggested timestamp to use when reporting.value- Value to be reported.
-
-