Class ChainedCollector<C extends Collector>
- java.lang.Object
-
- org.kairosdb.metrics4j.collectors.helpers.Cloneable
-
- org.kairosdb.metrics4j.collectors.helpers.ChainedCollector<C>
-
- Type Parameters:
C- Type of collector to chain
- All Implemented Interfaces:
Serializable,Cloneable,Collector,MetricCollector,PostConstruct
- Direct Known Subclasses:
ChainedDoubleCollector,ChainedDurationCollector,ChainedLongCollector,ChainedStringCollector,ChainedTimeCollector
public abstract class ChainedCollector<C extends Collector> extends Cloneable implements Collector
ChainedCollector lets you report metrics to more than one collector.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classChainedCollector.PrefixMetricReporter<C extends Collector>
-
Field Summary
Fields Modifier and Type Field Description protected List<String>collectorsprotected List<ChainedCollector.PrefixMetricReporter<C>>m_chainedCollectorsprotected List<String>prefixes
-
Constructor Summary
Constructors Constructor Description ChainedCollector()
-
Method Summary
All Methods Instance Methods Abstract 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)voidreportMetric(MetricReporter metricReporter)voidsetContextProperties(Map<String,String> contextProperties)abstract CvalidateCollector(Collector collector)
-
-
-
Method Detail
-
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
-
-