public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static double |
convertSemVerToGauge(String version) |
static String |
eventToLineData(String name,
long startMillis,
long endMillis,
String source,
Map<String,String> tags,
Map<String,String> annotations,
String defaultSource,
boolean jsonify) |
static Optional<ResourceBundle> |
getResource(String pathToResource)
Return the resource at the given resource path in the resource directory
META-INF/. |
static double |
getSemVerGauge(String artifactId)
Return the version of the given artifact Id as a gauge value to be reported to Wavefront.
|
static Optional<String> |
getVersion(String artifactId)
Return the version of the given artifact Id.
|
static String |
histogramToLineData(String name,
List<Pair<Double,Integer>> centroids,
Set<HistogramGranularity> histogramGranularities,
Long timestamp,
String source,
Map<String,String> tags,
String defaultSource) |
static String |
logToLineData(String name,
double value,
Long timestamp,
String source,
Map<String,String> tags,
String defaultSource) |
static String |
metricToLineData(String name,
double value,
Long timestamp,
String source,
Map<String,String> tags,
String defaultSource) |
static String |
sanitize(String s) |
static String |
sanitize(String s,
boolean ignoreSlash) |
static String |
sanitizeValue(String s) |
static String |
sanitizeWithoutQuotes(String s) |
static void |
shutdownExecutorAndWait(ExecutorService tpe) |
static String |
spanLogsToLineData(UUID traceId,
UUID spanId,
List<SpanLog> spanLogs) |
static String |
spanLogsToLineData(UUID traceId,
UUID spanId,
List<SpanLog> spanLogs,
String span) |
static String |
tracingSpanToLineData(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,
String defaultSource) |
public static String metricToLineData(String name, double value, @Nullable Long timestamp, String source, @Nullable Map<String,String> tags, String defaultSource)
public static String logToLineData(String name, double value, @Nullable Long timestamp, String source, @Nullable Map<String,String> tags, String defaultSource)
public static String histogramToLineData(String name, List<Pair<Double,Integer>> centroids, Set<HistogramGranularity> histogramGranularities, @Nullable Long timestamp, String source, @Nullable Map<String,String> tags, String defaultSource)
public static String tracingSpanToLineData(String name, long startMillis, long durationMillis, String source, UUID traceId, UUID spanId, @Nullable List<UUID> parents, @Nullable List<UUID> followsFrom, @Nullable List<Pair<String,String>> tags, @Nullable List<SpanLog> spanLogs, String defaultSource)
public static String eventToLineData(String name, long startMillis, long endMillis, @Nullable String source, @Nullable Map<String,String> tags, @Nullable Map<String,String> annotations, String defaultSource, boolean jsonify) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static String spanLogsToLineData(UUID traceId, UUID spanId, @NonNull List<SpanLog> spanLogs) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static String spanLogsToLineData(UUID traceId, UUID spanId, @NonNull List<SpanLog> spanLogs, @Nullable String span) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static void shutdownExecutorAndWait(ExecutorService tpe)
public static Optional<ResourceBundle> getResource(String pathToResource)
META-INF/.pathToResource - public static Optional<String> getVersion(String artifactId)
META-INF/. The file should contain a line that specifies the project version as
"project.version".artifactId - public static double getSemVerGauge(String artifactId)
META-INF/. The file should contain a line that specifies the project version as
"project.version".
Format of semantic version gauge value reported to Wavefront =
artifactId - public static double convertSemVerToGauge(String version)
Copyright © 2022. All rights reserved.