public class Wavefront extends AbstractProxyConnectionHandler implements WavefrontSender
| Constructor and Description |
|---|
Wavefront(InetSocketAddress agentAddress)
Creates a new client which connects to the given address using the default
SocketFactory. |
Wavefront(InetSocketAddress agentAddress,
SocketFactory socketFactory)
Creates a new client which connects to the given address and socket factory using the given
character set.
|
Wavefront(InetSocketAddress agentAddress,
SocketFactory socketFactory,
Long connectionTimeToLiveMillis,
java.util.function.Supplier<Long> timeSupplier)
Creates a new client which connects to the given address and socket factory and enforces connection TTL limit
|
Wavefront(String agentHostName,
int port)
Creates a new client which connects to the given address using the default
SocketFactory. |
Wavefront(String agentHostName,
int port,
SocketFactory socketFactory)
Creates a new client which connects to the given address and socket factory.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getFailureCount()
Returns the number of failed writes to the server.
|
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.
|
close, connect, flush, isConnected, sendDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnect, flush, isConnectedpublic Wavefront(String agentHostName, int port)
SocketFactory.agentHostName - The hostname of the Wavefront Proxy Agentport - The port of the Wavefront Proxy Agentpublic Wavefront(String agentHostName, int port, SocketFactory socketFactory)
agentHostName - The hostname of the Wavefront Proxy Agentport - The port of the Wavefront Proxy AgentsocketFactory - the socket factorypublic Wavefront(InetSocketAddress agentAddress)
SocketFactory.agentAddress - the address of the Wavefront Proxy Agentpublic Wavefront(InetSocketAddress agentAddress, SocketFactory socketFactory)
agentAddress - the address of the Wavefront Proxy AgentsocketFactory - the socket factorypublic Wavefront(InetSocketAddress agentAddress, SocketFactory socketFactory, @Nullable Long connectionTimeToLiveMillis, @Nullable java.util.function.Supplier<Long> timeSupplier)
agentAddress - the address of the Wavefront Proxy AgentsocketFactory - the socket factoryconnectionTimeToLiveMillis - Connection TTL, with expiration checked after each flush. When null,
TTL is not enforced.timeSupplier - Get current timestamp in millispublic 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 int getFailureCount()
WavefrontConnectionHandlergetFailureCount in interface WavefrontConnectionHandlerCopyright © 2018. All rights reserved.