Package org.apache.storm.loadgen

# Class HttpForwardingMetricsConsumer

java.lang.Object
org.apache.storm.loadgen.HttpForwardingMetricsConsumer

All Implemented Interfaces:
  `IMetricsConsumer`

public class HttpForwardingMetricsConsumer extends Object implements IMetricsConsumer
Listens for all metrics and POSTs them serialized to a configured URL.

To use, add this to your topology's configuration: ```java conf.registerMetricsConsumer(HttpForwardingMetricsConsumer.class, "http://example.com:8080/metrics/my-topology/", 1); ```

The body of the post is data serialized using `KryoValuesSerializer`, with the data passed in as a list of `[TaskInfo, Collection<DataPoint>]`. More things may be appended to the end of the list in the future.

The values can be deserialized using the org.apache.storm.serialization.KryoValuesDeserializer, and a correct config + classpath.

@see org.apache.storm.serialization.KryoValuesSerializer

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.storm.metric.api.IMetricsConsumer

  `IMetricsConsumer.DataPoint, IMetricsConsumer.TaskInfo`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HttpForwardingMetricsConsumer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `cleanup()`
  `void`
  `handleDataPoints(IMetricsConsumer.TaskInfo taskInfo, Collection<IMetricsConsumer.DataPoint> dataPoints)`
  `void`
  `prepare(Map<String,Object> topoConf, Object registrationArgument, TopologyContext context, IErrorReporter errorReporter)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### HttpForwardingMetricsConsumer

    public HttpForwardingMetricsConsumer()

- ## Method Details

  - ### prepare

    public void prepare(Map<String,Object> topoConf, Object registrationArgument, TopologyContext context, IErrorReporter errorReporter)
    Specified by:
      `prepare` in interface `IMetricsConsumer`

  - ### handleDataPoints

    public void handleDataPoints(IMetricsConsumer.TaskInfo taskInfo, Collection<IMetricsConsumer.DataPoint> dataPoints)
    Specified by:
      `handleDataPoints` in interface `IMetricsConsumer`

  - ### cleanup

    public void cleanup()
    Specified by:
      `cleanup` in interface `IMetricsConsumer`