Class LongGauge
- java.lang.Object
-
- org.kairosdb.metrics4j.collectors.impl.LongGauge
-
- All Implemented Interfaces:
Serializable,Collector,LongCollector,MetricCollector,PostConstruct
- Direct Known Subclasses:
MaxLongGauge
public class LongGauge extends Object implements LongCollector
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AtomicLongm_gaugeprotected Map<String,String>m_reportContextprotected booleanreset
-
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(long value)Place a long value into the collector to be reported.voidput(Instant time, long count)Place a long value and associated timestamp into the collector to be reported.voidreportMetric(MetricReporter metricReporter)voidsetContextProperties(Map<String,String> contextProperties)
-
-
-
Field Detail
-
m_gauge
protected final AtomicLong m_gauge
-
reset
protected boolean reset
-
-
Method Detail
-
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 count)
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.count- 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.
-
init
public void init(MetricsContext context)
- Specified by:
initin interfacePostConstruct
-
reportMetric
public void reportMetric(MetricReporter metricReporter)
- Specified by:
reportMetricin interfaceMetricCollector
-
setContextProperties
public void setContextProperties(Map<String,String> contextProperties)
- Specified by:
setContextPropertiesin interfaceMetricCollector
-
-