public class GMetric extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
GMetric.UDPAddressingMode |
| Constructor and Description |
|---|
GMetric(String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl)
Constructs a GMetric
|
GMetric(String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl,
boolean ganglia311)
Constructs a GMetric
|
GMetric(String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl,
boolean ganglia311,
UUID uuid)
Constructs a GMetric
|
GMetric(String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl,
boolean ganglia311,
UUID uuid,
String spoof)
Constructs a GMetric
|
| Modifier and Type | Method and Description |
|---|---|
void |
announce(String name,
double value,
String group)
Announces a metric
|
void |
announce(String name,
float value,
String group)
Announces a metric
|
void |
announce(String name,
int value,
String group)
Announces a metric
|
void |
announce(String name,
long value,
String group)
Announces a metric
|
void |
announce(String name,
String value,
GMetricType type,
String units,
GMetricSlope slope,
int tmax,
int dmax,
String group)
The Ganglia Metric Client (gmetric) announces a metric
|
void |
close()
Closes the underlying protocol.
|
protected void |
finalize() |
static void |
main(String[] args)
Main method that sends a test metric
|
public GMetric(String group, int port, GMetric.UDPAddressingMode mode, int ttl) throws IOException
group - the host/group to send the event toport - the port to send the event tomode - the modettl - time to live valueIOExceptionpublic GMetric(String group, int port, GMetric.UDPAddressingMode mode, int ttl, boolean ganglia311) throws IOException
group - the host/group to send the event toport - the port to send the event tomode - adressing mode to be used (UNICAST/MULTICAST)ttl - time to live valueganglia311 - protocol version true=v3.1, false=v3.0IOExceptionpublic GMetric(String group, int port, GMetric.UDPAddressingMode mode, int ttl, boolean ganglia311, UUID uuid) throws IOException
group - the host/group to send the event toport - the port to send the event tomode - adressing mode to be used (UNICAST/MULTICAST)ttl - time to live valueganglia311 - protocol version true=v3.1, false=v3.0uuid - uuid for the hostIOExceptionpublic GMetric(String group, int port, GMetric.UDPAddressingMode mode, int ttl, boolean ganglia311, UUID uuid, String spoof) throws IOException
group - the host/group to send the event toport - the port to send the event tomode - adressing mode to be used (UNICAST/MULTICAST)ttl - time to live valueganglia311 - protocol version true=v3.1, false=v3.0uuid - uuid for the hostspoof - spoofing information IP:hostnameIOExceptionpublic void announce(String name, String value, GMetricType type, String units, GMetricSlope slope, int tmax, int dmax, String group) throws GangliaException
name - Name of the metricvalue - Value of the metrictype - Type of the metric. Either
string|int8|uint8|int16|uint16|int32|uint32|float|doubleunits - Unit of measure for the valueslope - Either zero|positive|negative|bothtmax - The maximum time in seconds between gmetric callsdmax - The lifetime in seconds of this metricgroup - Group Name of the metricExceptionGangliaExceptionpublic void announce(String name, int value, String group) throws GangliaException
name - Name of the metricvalue - Value of the metricgroup - Group Name of the metricganglia.GangliaExceptionGangliaExceptionpublic void announce(String name, long value, String group) throws GangliaException
name - Name of the metricvalue - Value of the metricgroup - Group Name of the metricganglia.GangliaExceptionGangliaExceptionpublic void announce(String name, float value, String group) throws GangliaException
name - Name of the metricvalue - Value of the metricgroup - Group Name of the metricganglia.GangliaExceptionGangliaExceptionpublic void announce(String name, double value, String group) throws GangliaException
name - Name of the metricvalue - Value of the metricgroup - Group Name of the metricganglia.GangliaExceptionGangliaExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionprotected void finalize()
throws Throwable
finalize in class ObjectThrowableObject.finalize()public static void main(String[] args) throws IOException
args - IOExceptionCopyright © 2014. All rights reserved.