Class LastTime
- java.lang.Object
-
- org.kairosdb.metrics4j.collectors.helpers.TimerCollector
-
- org.kairosdb.metrics4j.collectors.impl.LastTime
-
- All Implemented Interfaces:
Serializable,Collector,DurationCollector,MetricCollector,PostConstruct
public class LastTime extends TimerCollector implements DurationCollector, MetricCollector
- 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 AtomicReference<Duration>m_lastTime-
Fields inherited from class org.kairosdb.metrics4j.collectors.helpers.TimerCollector
m_reportContext, m_timeReporter
-
-
Constructor Summary
Constructors Constructor Description LastTime()
-
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(Duration duration)Place a Duration value into the collector to be reported.voidput(Instant time, Duration duration)Place a Duration 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_lastTime
protected AtomicReference<Duration> m_lastTime
-
-
Method Detail
-
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
-
init
public void init(MetricsContext context)
- Specified by:
initin interfacePostConstruct
-
reportMetric
public void reportMetric(MetricReporter metricReporter)
- Specified by:
reportMetricin interfaceMetricCollector
-
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.
-
-