public class WavefrontDirectSender extends Object implements WavefrontSender, Runnable
| Constructor and Description |
|---|
WavefrontDirectSender(String server,
String token) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
connect()
Connects to the server.
|
void |
flush()
Flushes buffer, if applicable
|
int |
getFailureCount()
Returns the number of failed writes to the server.
|
boolean |
isConnected()
Returns true if ready to send data
|
void |
run() |
void |
send(String name,
double value)
Send a measurement to Wavefront.
|
void |
send(String name,
double value,
Long timestamp)
Send a measurement to Wavefront.
|
void |
send(String name,
double value,
Long timestamp,
String source)
Send a measurement to Wavefront.
|
void |
send(String name,
double value,
Long timestamp,
String source,
Map<String,String> pointTags)
Send the given measurement to the server.
|
void |
send(String name,
double value,
String source,
Map<String,String> pointTags)
Send the given measurement to the server.
|
public void connect()
throws IllegalStateException,
IOException
WavefrontSenderconnect in interface WavefrontSenderIllegalStateException - if the client is already connectedIOException - if there is an error connectingpublic void send(String name, double value) throws IOException
WavefrontSendersend in interface WavefrontSendername - The name of the metric. Spaces are replaced with '-' (dashes) and quotes will be automatically
escaped.value - The value to be sent.IOException - Throws if there was an error sending the metric.UnknownHostException - Throws if there's an error determining the current host.public void send(String name, double value, @Nullable Long timestamp) throws IOException
WavefrontSendersend in interface WavefrontSendername - The name of the metric. Spaces are replaced with '-' (dashes) and quotes will be automatically
escaped.value - The value to be sent.timestamp - The timestamp in seconds since the epoch to be sent.IOException - Throws if there was an error sending the metric.UnknownHostException - Throws if there's an error determining the current host.public void send(String name, double value, @Nullable Long timestamp, String source) throws IOException
WavefrontSendersend in interface WavefrontSendername - The name of the metric. Spaces are replaced with '-' (dashes) and quotes will be automatically
escaped.value - The value to be sent.timestamp - The timestamp in seconds since the epoch to be sent.source - The source (or host) that's sending the metric.IOException - if there was an error sending the metric.public void send(String name, double value, String source, @Nullable Map<String,String> pointTags) throws IOException
WavefrontSendersend in interface WavefrontSendername - The name of the metric. Spaces are replaced with '-' (dashes) and quotes will be automatically
escaped.value - The value to be sent.source - The source (or host) that's sending the metric. Null to use machine hostname.pointTags - The point tags associated with this measurement.IOException - if there was an error sending the metric.public void send(String name, double value, @Nullable Long timestamp, String source, @Nullable Map<String,String> pointTags) throws IOException
WavefrontSendersend in interface WavefrontSendername - The name of the metric. Spaces are replaced with '-' (dashes) and quotes will be automatically
escaped.value - The value to be sent.timestamp - The timestamp in seconds since the epoch to be sent. Null to use agent assigned timestamp.source - The source (or host) that's sending the metric. Null to use machine hostname.pointTags - The point tags associated with this measurement.IOException - if there was an error sending the metric.public void flush()
throws IOException
WavefrontSenderflush in interface WavefrontSenderIOExceptionpublic boolean isConnected()
WavefrontSenderisConnected in interface WavefrontSenderpublic int getFailureCount()
WavefrontSendergetFailureCount in interface WavefrontSenderpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2018. All rights reserved.