public class WavefrontMultiClient<T extends WavefrontSender & Runnable> extends Object implements WavefrontSender, Runnable
| Modifier and Type | Class and Description |
|---|---|
static class |
WavefrontMultiClient.Builder<T extends WavefrontSender & Runnable> |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush()
Flushes buffer, if applicable
|
T |
getClient(String clientId)
Provide direct access to a specific client by id.
|
String |
getClientId() |
int |
getFailureCount()
Returns the number of failed writes to the server.
|
Map<String,Integer> |
getFailureCountPerSender()
Obtain the failure counts per endpoint.
|
void |
run() |
void |
sendDistribution(String name,
List<Pair<Double,Integer>> centroids,
Set<HistogramGranularity> histogramGranularities,
Long timestamp,
String source,
Map<String,String> tags) |
void |
sendFormattedMetric(String point)
Similar to
WavefrontMetricSender.sendMetric(String, double, Long, String, Map), only the point
argument is expected to already be in Wavefront Data Format |
void |
sendMetric(String name,
double value,
Long timestamp,
String source,
Map<String,String> tags)
Sends the given metric to Wavefront
|
void |
sendSpan(String name,
long startMillis,
long durationMillis,
String source,
UUID traceId,
UUID spanId,
List<UUID> parents,
List<UUID> followsFrom,
List<Pair<String,String>> tags,
List<SpanLog> spanLogs)
Send a trace span to Wavefront.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendDeltaCounterpublic T getClient(String clientId)
clientId - the unique client ID generated when a Proxy or DirectIngestion Client is instantiated.public void flush()
throws IOException
BufferFlusherflush in interface BufferFlusherIOExceptionpublic int getFailureCount()
BufferFlushergetFailureCount in interface BufferFlusherpublic Map<String,Integer> getFailureCountPerSender()
public void sendMetric(String name, double value, @Nullable Long timestamp, @Nullable String source, @Nullable Map<String,String> tags) throws IOException
WavefrontMetricSendersendMetric in interface WavefrontMetricSendername - 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 milliseconds since the epoch to be sent. If null then the
timestamp is assigned by Wavefront when data is received.source - The source (or host) that's sending the metric. If null then assigned by
Wavefront.tags - The tags associated with this metric.IOException - if there was an error sending the metric.public void sendFormattedMetric(String point) throws IOException
WavefrontMetricSenderWavefrontMetricSender.sendMetric(String, double, Long, String, Map), only the point
argument is expected to already be in Wavefront Data FormatsendFormattedMetric in interface WavefrontMetricSenderpoint - a single metric, encoded in Wavefront Data FormatIOException - if there was an error sending the metric.public void sendDistribution(String name, List<Pair<Double,Integer>> centroids, Set<HistogramGranularity> histogramGranularities, @Nullable Long timestamp, @Nullable String source, @Nullable Map<String,String> tags) throws IOException
sendDistribution in interface WavefrontHistogramSendername - The name of the histogram distribution. Spaces are replaced
with '-' (dashes) and quotes will be automatically escaped.centroids - The distribution of histogram points to be sent.
Each centroid is a 2-dimensional Pair where the
first dimension is the mean value (Double) of the centroid
and second dimension is the count of points in that centroid.histogramGranularities - The set of intervals (minute, hour, and/or day) by which
histogram data should be aggregated.timestamp - The timestamp in milliseconds since the epoch to be sent.
If null then the timestamp is assigned by Wavefront when
data is received.source - The source (or host) that's sending the histogram. If
null, then assigned by Wavefront.tags - The tags associated with this histogram.IOException - If there was an error sending the histogram.public void sendSpan(String name, long startMillis, long durationMillis, @Nullable String source, UUID traceId, UUID spanId, @Nullable List<UUID> parents, @Nullable List<UUID> followsFrom, @Nullable List<Pair<String,String>> tags, @Nullable List<SpanLog> spanLogs) throws IOException
WavefrontTracingSpanSendersendSpan in interface WavefrontTracingSpanSendername - The operation name of the span.startMillis - The start time in milliseconds for this span.durationMillis - The duration of the span in milliseconds.source - The source (or host) that's sending the span. If null, then
assigned by Wavefront.traceId - The unique trace ID for the span.spanId - The unique span ID for the span.parents - The list of parent span IDs, can be null if this is a root span.followsFrom - The list of preceding span IDs, can be null if this is a root span.tags - The span tags associated with this span. Supports repeated tags.spanLogs - The span logs associated with this span.IOException - If there was an error sending the span.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic String getClientId()
getClientId in interface WavefrontSenderCopyright © 2019. All rights reserved.