org.apache.hadoop.metrics.ganglia
Class GangliaContext
java.lang.Object
   org.apache.hadoop.metrics.spi.AbstractMetricsContext
org.apache.hadoop.metrics.spi.AbstractMetricsContext
       org.apache.hadoop.metrics.ganglia.GangliaContext
org.apache.hadoop.metrics.ganglia.GangliaContext
- All Implemented Interfaces: 
- org.apache.hadoop.metrics.MetricsContext
- @InterfaceAudience.Public
@InterfaceStability.Evolving
public class GangliaContext 
- extends AbstractMetricsContext
Context for sending metrics to Ganglia.
 
| Fields inherited from interface org.apache.hadoop.metrics.MetricsContext | 
| DEFAULT_PERIOD | 
 
| Constructor Summary | 
| GangliaContext()Creates a new instance of GangliaContext
 | 
 
 
| Methods inherited from class org.apache.hadoop.metrics.spi.AbstractMetricsContext | 
| createRecord, flush, getAllRecords, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, isMonitoring, newRecord, parseAndSetPeriod, registerUpdater, remove, setPeriod, startMonitoring, stopMonitoring, unregisterUpdater, update | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
buffer
protected byte[] buffer
offset
protected int offset
metricsServers
protected List<? extends SocketAddress> metricsServers
datagramSocket
protected DatagramSocket datagramSocket
GangliaContext
@InterfaceAudience.Private
public GangliaContext()
- Creates a new instance of GangliaContext
 
close
public void close()
- method to close the datagram socket
 
- 
- Specified by:
- closein interface- org.apache.hadoop.metrics.MetricsContext
- Overrides:
- closein class- AbstractMetricsContext
 
- 
 
emitMetric
protected void emitMetric(String name,
                          String type,
                          String value)
                   throws IOException
- 
- Throws:
- IOException
 
getUnits
protected String getUnits(String metricName)
- 
 
getSlope
protected int getSlope(String metricName)
- 
 
getTmax
protected int getTmax(String metricName)
- 
 
getDmax
protected int getDmax(String metricName)
- 
 
xdr_string
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.
 
- 
 
xdr_int
protected void xdr_int(int i)
- Puts an integer into the buffer as 4 bytes, big-endian.
 
- 
 
Copyright © 2014 Apache Software Foundation. All Rights Reserved.