@InterfaceAudience.Public @InterfaceStability.Evolving 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 |
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) |
protected int |
getDmax(String metricName) |
protected int |
getSlope(String metricName) |
protected int |
getTmax(String metricName) |
protected String |
getUnits(String metricName) |
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, emitRecord, flush, getAllRecords, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, init, isMonitoring, newRecord, parseAndSetPeriod, registerUpdater, remove, setPeriod, startMonitoring, stopMonitoring, unregisterUpdater, update
protected byte[] buffer
protected int offset
protected List<? extends SocketAddress> metricsServers
protected DatagramSocket datagramSocket
@InterfaceAudience.Private public GangliaContext()
public void close()
close
in interface org.apache.hadoop.metrics.MetricsContext
close
in class AbstractMetricsContext
protected void emitMetric(String name, String type, String value) throws IOException
IOException
protected void xdr_string(String s)
protected void xdr_int(int i)
Copyright © 2017 Apache Software Foundation. All rights reserved.