Class BagCollector
- java.lang.Object
-
- org.kairosdb.metrics4j.collectors.helpers.TimerCollector
-
- org.kairosdb.metrics4j.collectors.impl.BagCollector
-
- All Implemented Interfaces:
Serializable,Collector,DoubleCollector,DurationCollector,LongCollector,MetricCollector,StringCollector,PostConstruct
public class BagCollector extends TimerCollector implements LongCollector, DoubleCollector, StringCollector
This collector does not do any aggregation. Whatever value was put into the collector is reported using the time of the put or the Instant if one was provided. This collector will also honor any request time set on the thread via MetricThreadHelper- 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 inherited from class org.kairosdb.metrics4j.collectors.helpers.TimerCollector
m_timeReporter
-
-
Constructor Summary
Constructors Constructor Description BagCollector()
-
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 value)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, 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.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.MetricCollector
setContextProperties
-
-
-
-
Method Detail
-
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(long value)
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:
value- 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
-
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.
-
-