public class GangliaContext extends AbstractMetricsContext
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buffer |
protected DatagramSocket |
datagramSocket |
protected List<? extends SocketAddress> |
metricsServers |
protected int |
offset |
DEFAULT_PERIOD
Constructor and Description |
---|
GangliaContext()
Creates a new instance of GangliaContext
|
Modifier and Type | Method and Description |
---|---|
protected void |
emitMetric(String name,
String type,
String value) |
void |
emitRecord(String contextName,
String recordName,
OutputRecord outRec)
Sends a record to the metrics system.
|
protected int |
getDmax(String metricName) |
protected int |
getSlope(String metricName) |
protected int |
getTmax(String metricName) |
protected String |
getUnits(String metricName) |
void |
init(String contextName,
ContextFactory factory)
Initializes the context.
|
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.
|
close, createRecord, flush, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, isMonitoring, newRecord, registerUpdater, remove, setPeriod, startMonitoring, stopMonitoring, unregisterUpdater, update
protected byte[] buffer
protected int offset
protected List<? extends SocketAddress> metricsServers
protected DatagramSocket datagramSocket
public void init(String contextName, ContextFactory factory)
AbstractMetricsContext
init
in interface MetricsContext
init
in class AbstractMetricsContext
contextName
- The given name for this contextfactory
- The creator of this contextpublic void emitRecord(String contextName, String recordName, OutputRecord outRec) throws IOException
AbstractMetricsContext
emitRecord
in class AbstractMetricsContext
IOException
protected void emitMetric(String name, String type, String value) throws IOException
IOException
protected int getSlope(String metricName)
protected int getTmax(String metricName)
protected int getDmax(String metricName)
protected void xdr_string(String s)
protected void xdr_int(int i)
Copyright © 2010 The Apache Software Foundation