org.apache.flume.instrumentation.http
Class HTTPMetricsServer

java.lang.Object
  extended by org.apache.flume.instrumentation.http.HTTPMetricsServer
All Implemented Interfaces:
Configurable, MonitorService

public class HTTPMetricsServer
extends Object
implements MonitorService

A Monitor service implementation that runs a web server on a configurable port and returns the metrics for components in JSON format.

Optional parameters:

port : The port on which the server should listen to.

Returns metrics in the following format:

{

"componentName1":{"metric1" : "metricValue1","metric2":"metricValue2"}

"componentName1":{"metric3" : "metricValue3","metric4":"metricValue4"}

}


Field Summary
static String CONFIG_PORT
           
static int DEFAULT_PORT
           
 
Constructor Summary
HTTPMetricsServer()
           
 
Method Summary
 void configure(Context context)
           Request the implementing class to (re)configure itself.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static int DEFAULT_PORT

CONFIG_PORT

public static String CONFIG_PORT
Constructor Detail

HTTPMetricsServer

public HTTPMetricsServer()
Method Detail

start

public void start()
Specified by:
start in interface MonitorService

stop

public void stop()
Specified by:
stop in interface MonitorService

configure

public void configure(Context context)
Description copied from interface: Configurable

Request the implementing class to (re)configure itself.

When configuration parameters are changed, they must be reflected by the component asap.

There are no thread safety guarrantees on when configure might be called.

Specified by:
configure in interface Configurable


Copyright © 2009-2012 Apache Software Foundation. All Rights Reserved.