public class AggregateMetricReader extends Object implements MetricReader
*.*.counter.**
and
*.*.[anything].**
, and the result has metric names in the form
aggregate.count.**
and aggregate.[anything].**
. Counters are summed and
anything else (i.e. gauges) are aggregated by choosing the most recent value.Constructor and Description |
---|
AggregateMetricReader(MetricReader source) |
Modifier and Type | Method and Description |
---|---|
long |
count()
The number of metrics known to this reader.
|
Iterable<Metric<?>> |
findAll()
Find all the metrics known to this reader.
|
Metric<?> |
findOne(String metricName)
Find an instance of the metric with the given name (usually the latest recorded
value).
|
void |
setKeyPattern(String keyPattern)
Pattern that tells the aggregator what to do with the keys from the source
repository.
|
void |
setPrefix(String prefix)
Prefix to apply to all output metrics.
|
public AggregateMetricReader(MetricReader source)
public void setKeyPattern(String keyPattern)
keyPattern
- the keyPattern to setpublic void setPrefix(String prefix)
prefix
- the prefix to use (default "aggregator.")public Metric<?> findOne(String metricName)
MetricReader
findOne
in interface MetricReader
metricName
- the name of the metric to findpublic Iterable<Metric<?>> findAll()
MetricReader
findAll
in interface MetricReader
public long count()
MetricReader
count
in interface MetricReader
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.