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 valueIOException
public 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.0IOException
public 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 hostIOException
public 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:hostnameIOException
public 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 metricException
GangliaException
public void announce(String name, int value, String group) throws GangliaException
name
- Name of the metricvalue
- Value of the metricgroup
- Group Name of the metricganglia.GangliaException
GangliaException
public void announce(String name, long value, String group) throws GangliaException
name
- Name of the metricvalue
- Value of the metricgroup
- Group Name of the metricganglia.GangliaException
GangliaException
public void announce(String name, float value, String group) throws GangliaException
name
- Name of the metricvalue
- Value of the metricgroup
- Group Name of the metricganglia.GangliaException
GangliaException
public void announce(String name, double value, String group) throws GangliaException
name
- Name of the metricvalue
- Value of the metricgroup
- Group Name of the metricganglia.GangliaException
GangliaException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
protected void finalize() throws Throwable
finalize
in class Object
Throwable
Object.finalize()
public static void main(String[] args) throws IOException
args
- IOException
Copyright © 2016. All rights reserved.