public class MetricController extends Object
Constructor and Description |
---|
MetricController(com.yahoo.bullet.common.metrics.MetricPublisher metricPublisher,
com.yahoo.bullet.common.metrics.MetricCollector metricCollector)
Creates a controller that reports to the given
MetricPublisher the various metrics collected in the
given MetricCollector . |
Modifier and Type | Method and Description |
---|---|
protected void |
incrementMetric(String metric)
Increment the given metric.
|
protected void |
incrementMetric(String prefix,
Metric metric)
Increments the
Metric with a given prefix to attach to it. |
void |
publishMetrics()
Fires and forgets the metrics using the publisher.
|
static List<String> |
toMetric(String prefix,
Metric... metrics)
Concatenates a String prefix to the given metrics.
|
public MetricController(com.yahoo.bullet.common.metrics.MetricPublisher metricPublisher, com.yahoo.bullet.common.metrics.MetricCollector metricCollector)
MetricPublisher
the various metrics collected in the
given MetricCollector
.metricPublisher
- The MetricPublisher
to use to report metrics.metricCollector
- The MetricCollector
to use.@Scheduled(fixedDelayString="${bullet.metric.publish.interval.ms}") public void publishMetrics()
protected void incrementMetric(String prefix, Metric metric)
Metric
with a given prefix to attach to it.prefix
- The prefix to attach to the given metric.metric
- The Metric
name.protected void incrementMetric(String metric)
metric
- The String name of the metric.Copyright © 2021 Pivotal Software, Inc.. All rights reserved.