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.MetricWriterMessageHandler
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)
CounterWriter
increment
in interface CounterWriter
delta
- the amount to increment bypublic void set(Metric<?> value)
GaugeWriter
set
in interface GaugeWriter
value
- the valuepublic void reset(String metricName)
CounterWriter
reset
in interface CounterWriter
metricName
- the name to resetCopyright © 2016 Pivotal Software, Inc.. All rights reserved.