Class TimeDelta
- java.lang.Object
-
- org.kairosdb.metrics4j.collectors.helpers.TimerCollector
-
- org.kairosdb.metrics4j.collectors.impl.SimpleTimerMetric
-
- org.kairosdb.metrics4j.collectors.impl.TimeDelta
-
- All Implemented Interfaces:
Serializable,Collector,DurationCollector,MetricCollector,TimeCollector,PostConstruct
public class TimeDelta extends SimpleTimerMetric implements TimeCollector
This records the difference between now (computers local clock) and the timestamp provided. The deltas are recorded as a SimpleTimerMetric- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.kairosdb.metrics4j.collectors.impl.SimpleTimerMetric
SimpleTimerMetric.Data
-
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 inherited from class org.kairosdb.metrics4j.collectors.impl.SimpleTimerMetric
m_count, m_dataLock, m_max, m_min, m_sum, reportZero
-
Fields inherited from class org.kairosdb.metrics4j.collectors.helpers.TimerCollector
m_reportContext, m_timeReporter
-
-
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(Instant value)Place a double value into the collector to be reported.voidput(Instant time, Instant value)Place a double value and associated timestamp into the collector to be reported.-
Methods inherited from class org.kairosdb.metrics4j.collectors.impl.SimpleTimerMetric
getCount, put, put, reportMetric, setReportUnit
-
Methods inherited from class org.kairosdb.metrics4j.collectors.helpers.TimerCollector
getReportFormat, getReportUnit, setContextProperties, setReportFormat, 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
reportMetric, setContextProperties
-
-
-
-
Constructor Detail
-
TimeDelta
public TimeDelta(Clock clock)
-
TimeDelta
public TimeDelta()
-
-
Method Detail
-
put
public void put(Instant value)
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:
value- 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.
-
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- Overrides:
clonein classSimpleTimerMetric- Returns:
- Clone of this collector
-
init
public void init(MetricsContext context)
- Specified by:
initin interfacePostConstruct- Overrides:
initin classSimpleTimerMetric
-
-