Class SimpleStats
- java.lang.Object
-
- org.kairosdb.metrics4j.collectors.impl.SimpleStats
-
- All Implemented Interfaces:
Serializable,Collector,LongCollector,MetricCollector,PostConstruct
public class SimpleStats extends Object implements LongCollector, MetricCollector
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static SummaryContextAVG_QUANTILEprotected longm_countprotected Objectm_dataLockprotected longm_maxprotected longm_minprotected longm_sumstatic SummaryContextMAX_QUANTILEstatic SummaryContextMIN_QUANTILEprotected booleanreportZeroReport zero values during interval if no data is received.static DoubleValueZERO_DOUBLEstatic LongValueZERO_LONG
-
Constructor Summary
Constructors Constructor Description SimpleStats()SimpleStats(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.voidinit(MetricsContext context)voidput(long value)Place a long value into the collector to be reported.voidput(Instant time, long value)Place a long value and associated timestamp into the collector to be reported.voidreportMetric(MetricReporter metricReporter)voidreset()voidsetContextProperties(Map<String,String> contextProperties)
-
-
-
Field Detail
-
MIN_QUANTILE
public static final SummaryContext MIN_QUANTILE
-
MAX_QUANTILE
public static final SummaryContext MAX_QUANTILE
-
AVG_QUANTILE
public static final SummaryContext AVG_QUANTILE
-
ZERO_LONG
public static final LongValue ZERO_LONG
-
ZERO_DOUBLE
public static final DoubleValue ZERO_DOUBLE
-
m_min
protected long m_min
-
m_max
protected long m_max
-
m_sum
protected long m_sum
-
m_count
protected long m_count
-
m_dataLock
protected final Object m_dataLock
-
reportZero
protected boolean reportZero
Report zero values during interval if no data is received.
-
-
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 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.
-
reset
public void reset()
-
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
-
-