public interface WavefrontSender extends Closeable
Modifier and Type | Method and Description |
---|---|
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 |
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.
|
void connect() throws IllegalStateException, IOException
IllegalStateException
- if the client is already connectedIOException
- if there is an error connectingvoid send(String name, double value) throws IOException
name
- 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.void send(String name, double value, @Nullable Long timestamp) throws IOException
name
- 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.void send(String name, double value, @Nullable Long timestamp, String source) throws IOException
name
- 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.void send(String name, double value, String source, @Nullable Map<String,String> pointTags) throws IOException
name
- 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.void send(String name, double value, @Nullable Long timestamp, String source, @Nullable Map<String,String> pointTags) throws IOException
name
- 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.void flush() throws IOException
IOException
boolean isConnected()
int getFailureCount()
Copyright © 2017. All rights reserved.