public class MessageChannelMetricWriter extends Object implements MetricWriter
MetricWriter
that publishes the metric updates on a MessageChannel
.
The messages have the writer input (Delta
or Metric
) as payload, and
carry an additional header "metricName" with the name of the metric in it.Constructor and Description |
---|
MessageChannelMetricWriter(MessageChannel channel) |
Modifier and Type | Method and Description |
---|---|
void |
increment(Delta<?> delta)
Increment the value of a metric (or decrement if the delta is negative).
|
void |
reset(String metricName)
Reset the value of a metric, usually to zero value.
|
void |
set(Metric<?> value)
Set the value of a metric.
|
public MessageChannelMetricWriter(MessageChannel channel)
public void increment(Delta<?> delta)
MetricWriter
increment
in interface MetricWriter
delta
- the amount to increment bypublic void set(Metric<?> value)
MetricWriter
set
in interface MetricWriter
public void reset(String metricName)
MetricWriter
reset
in interface MetricWriter
metricName
- the name to resetCopyright © 2014 Pivotal Software, Inc.. All rights reserved.