public class GMetric
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
GMetric.UDPAddressingMode |
| Constructor and Description |
|---|
GMetric(java.lang.String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl)
Constructs a GMetric
|
GMetric(java.lang.String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl,
boolean ganglia311)
Constructs a GMetric
|
GMetric(java.lang.String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl,
boolean ganglia311,
java.util.UUID uuid)
Constructs a GMetric
|
GMetric(java.lang.String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl,
boolean ganglia311,
java.util.UUID uuid,
java.lang.String spoof)
Constructs a GMetric
|
| Modifier and Type | Method and Description |
|---|---|
void |
announce(java.lang.String name,
double value,
java.lang.String group)
Announces a metric
|
void |
announce(java.lang.String name,
float value,
java.lang.String group)
Announces a metric
|
void |
announce(java.lang.String name,
int value,
java.lang.String group)
Announces a metric
|
void |
announce(java.lang.String name,
long value,
java.lang.String group)
Announces a metric
|
void |
announce(java.lang.String name,
java.lang.String value,
GMetricType type,
java.lang.String units,
GMetricSlope slope,
int tmax,
int dmax,
java.lang.String group)
The Ganglia Metric Client (gmetric) announces a metric
|
void |
close()
Closes the underlying protocol.
|
protected void |
finalize() |
static void |
main(java.lang.String[] args)
Main method that sends a test metric
|
private Protocol protocol
public GMetric(java.lang.String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl)
throws java.io.IOException
group - the host/group to send the event toport - the port to send the event tomode - the modettl - time to live valuejava.io.IOExceptionpublic GMetric(java.lang.String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl,
boolean ganglia311)
throws java.io.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.0java.io.IOExceptionpublic GMetric(java.lang.String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl,
boolean ganglia311,
java.util.UUID uuid)
throws java.io.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 hostjava.io.IOExceptionpublic GMetric(java.lang.String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl,
boolean ganglia311,
java.util.UUID uuid,
java.lang.String spoof)
throws java.io.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:hostnamejava.io.IOExceptionpublic void announce(java.lang.String name,
java.lang.String value,
GMetricType type,
java.lang.String units,
GMetricSlope slope,
int tmax,
int dmax,
java.lang.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 metricjava.lang.ExceptionGangliaExceptionpublic void announce(java.lang.String name,
int value,
java.lang.String group)
throws GangliaException
name - Name of the metricvalue - Value of the metricgroup - Group Name of the metricganglia.GangliaExceptionGangliaExceptionpublic void announce(java.lang.String name,
long value,
java.lang.String group)
throws GangliaException
name - Name of the metricvalue - Value of the metricgroup - Group Name of the metricganglia.GangliaExceptionGangliaExceptionpublic void announce(java.lang.String name,
float value,
java.lang.String group)
throws GangliaException
name - Name of the metricvalue - Value of the metricgroup - Group Name of the metricganglia.GangliaExceptionGangliaExceptionpublic void announce(java.lang.String name,
double value,
java.lang.String group)
throws GangliaException
name - Name of the metricvalue - Value of the metricgroup - Group Name of the metricganglia.GangliaExceptionGangliaExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.ThrowableObject.finalize()public static void main(java.lang.String[] args)
throws java.io.IOException
args - java.io.IOException