|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.flume.instrumentation.GangliaServer
public class GangliaServer
A Ganglia server that polls JMX based at a configured frequency (defaults to once every 60 seconds). This implementation can send data to ganglia 3 and ganglia 3.1.
Mandatory Parameters:
hosts: List of comma separated hostname:ports of ganglia servers to report metrics to.
Optional Parameters:
pollFrequency:Interval in seconds between consecutive reports to ganglia servers. Default = 60 seconds.
isGanglia3: Report to ganglia 3 ? Default = false - reports to ganglia 3.1.
Nested Class Summary | |
---|---|
protected class |
GangliaServer.GangliaCollector
Worker which polls JMX for all mbeans with ObjectName within the flume namespace:
org.apache.flume. |
Field Summary | |
---|---|
protected byte[] |
buffer
|
static int |
BUFFER_SIZE
|
protected GangliaServer.GangliaCollector |
collectorRunnable
|
String |
CONF_HOSTS
|
String |
CONF_ISGANGLIA3
|
String |
CONF_POLL_FREQUENCY
|
static int |
DEFAULT_DMAX
|
int |
DEFAULT_POLL_FREQUENCY
|
static int |
DEFAULT_SLOPE
|
static int |
DEFAULT_TMAX
|
static String |
DEFAULT_UNITS
|
static String |
GANGLIA_DOUBLE_TYPE
|
protected int |
offset
|
Constructor Summary | |
---|---|
GangliaServer()
|
Method Summary | |
---|---|
void |
configure(Context context)
Request the implementing class to (re)configure itself. |
protected void |
createGangliaMessage(String name,
String value)
|
protected void |
createGangliaMessage31(String name,
String value)
|
int |
getPollFrequency()
|
boolean |
isGanglia3()
|
void |
sendToGangliaNodes()
|
void |
setIsGanglia3(boolean isGanglia3)
|
void |
setPollFrequency(int pollFrequency)
|
void |
start()
Start this server, causing it to poll JMX at the configured frequency. |
void |
stop()
Stop this server. |
protected void |
xdr_int(int i)
Puts an integer into the buffer as 4 bytes, big-endian. |
protected void |
xdr_string(String s)
Puts a string into the buffer by first writing the size of the string as an int, followed by the bytes of the string, padded if necessary to a multiple of 4. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BUFFER_SIZE
protected byte[] buffer
protected int offset
protected final GangliaServer.GangliaCollector collectorRunnable
public static final String DEFAULT_UNITS
public static final int DEFAULT_TMAX
public static final int DEFAULT_DMAX
public static final int DEFAULT_SLOPE
public static final String GANGLIA_DOUBLE_TYPE
public final String CONF_POLL_FREQUENCY
public final int DEFAULT_POLL_FREQUENCY
public final String CONF_HOSTS
public final String CONF_ISGANGLIA3
Constructor Detail |
---|
public GangliaServer() throws FlumeException
hosts
- List of hosts to send the metrics to. All of them have to be
running the version of ganglia specified by the configuration.
FlumeException
Method Detail |
---|
protected void xdr_string(String s)
s
- the string to be written to buffer at offset locationprotected void xdr_int(int i)
public void sendToGangliaNodes()
public void start()
start
in interface MonitorService
public void stop()
stop
in interface MonitorService
public void setPollFrequency(int pollFrequency)
pollFrequency
- Seconds between consecutive JMX polls.public int getPollFrequency()
public void setIsGanglia3(boolean isGanglia3)
isGanglia3
- When true, ganglia 3 messages will be sent, else Ganglia
3.1 formatted messages are sent.public boolean isGanglia3()
protected void createGangliaMessage(String name, String value)
protected void createGangliaMessage31(String name, String value)
public void configure(Context context)
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.
configure
in interface Configurable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |