public class GangliaServer extends Object implements MonitorService
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.
Modifier and Type | Class and Description |
---|---|
protected class |
GangliaServer.GangliaCollector
Worker which polls JMX for all mbeans with
ObjectName within the flume namespace:
org.apache.flume. |
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
GangliaServer() |
Modifier and Type | Method and Description |
---|---|
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.
|
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
public GangliaServer() throws FlumeException
FlumeException
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()
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 guarantees on when configure might be called.
configure
in interface Configurable
Copyright © 2009–2019 Apache Software Foundation. All rights reserved.