Class SimpleTimerMetric
- java.lang.Object
-
- org.kairosdb.metrics4j.collectors.helpers.TimerCollector
-
- org.kairosdb.metrics4j.collectors.impl.SimpleTimerMetric
-
- All Implemented Interfaces:
Serializable,Collector,DurationCollector,MetricCollector,PostConstruct
- Direct Known Subclasses:
TimeDelta
public class SimpleTimerMetric extends TimerCollector implements DurationCollector, MetricCollector
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleTimerMetric.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 Modifier and Type Field Description protected longm_countprotected Objectm_dataLockprotected Durationm_maxprotected Durationm_minprotected Durationm_sumprotected booleanreportZeroReport zero values during interval if no data is received.-
Fields inherited from class org.kairosdb.metrics4j.collectors.helpers.TimerCollector
m_reportContext, m_timeReporter
-
-
Constructor Summary
Constructors Constructor Description SimpleTimerMetric()SimpleTimerMetric(ChronoUnit unit, 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.longgetCount()Not thread safevoidinit(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)voidsetReportUnit(ChronoUnit reportUnit)Unit to report metric as.-
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
setContextProperties
-
-
-
-
Constructor Detail
-
SimpleTimerMetric
public SimpleTimerMetric()
-
SimpleTimerMetric
public SimpleTimerMetric(ChronoUnit unit, boolean reportZero)
-
-
Method Detail
-
setReportUnit
public void setReportUnit(ChronoUnit reportUnit)
Description copied from class:TimerCollectorUnit to report metric as. Supported units are NANOS, MICROS, MILLIS, SECONDS, MINUTES, HOURS, DAYS- Overrides:
setReportUnitin classTimerCollector- Parameters:
reportUnit- Time unit
-
getCount
public long getCount()
Not thread safe- Returns:
- Call count
-
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.
-
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
-
-