@InterfaceAudience.Public @InterfaceStability.Evolving public class GangliaContext extends AbstractMetricsContext
AbstractMetricsContext.MetricMap, AbstractMetricsContext.TagMap| 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 |
|---|---|
void |
close()
method to close the datagram socket
|
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.
|
createRecord, flush, getAllRecords, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, isMonitoring, newRecord, parseAndSetPeriod, registerUpdater, remove, setPeriod, startMonitoring, stopMonitoring, unregisterUpdater, updateprotected byte[] buffer
protected int offset
protected List<? extends SocketAddress> metricsServers
protected DatagramSocket datagramSocket
@InterfaceAudience.Private public GangliaContext()
@InterfaceAudience.Private public void init(String contextName, ContextFactory factory)
AbstractMetricsContextinit in interface MetricsContextinit in class AbstractMetricsContextcontextName - The given name for this contextfactory - The creator of this contextpublic void close()
close in interface MetricsContextclose in class AbstractMetricsContext@InterfaceAudience.Private public void emitRecord(String contextName, String recordName, OutputRecord outRec) throws IOException
AbstractMetricsContextemitRecord in class AbstractMetricsContextIOExceptionprotected void emitMetric(String name, String type, String value) throws IOException
IOExceptionprotected 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 © 2013 Apache Software Foundation. All rights reserved.