public class MetricsUtils
extends java.lang.Object
Constructor and Description |
---|
MetricsUtils() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.String> |
cleanLabelNames(java.util.Map<java.lang.String,java.lang.String> raw)
Converts the label keys to snake_case.
|
static java.lang.String |
convertCase(java.lang.String raw)
Converts a tag/name to match the telemetry naming conventions by converting snake_case.
|
static java.lang.String |
fullMetricName(java.lang.String domain,
java.lang.String group,
java.lang.String name)
Creates a metric name given the domain, group, and name.
|
static com.google.protobuf.Timestamp |
now() |
static com.google.protobuf.Timestamp |
now(java.time.Clock clock) |
static java.time.Instant |
toInstant(com.google.protobuf.Timestamp timestamp) |
static com.google.protobuf.Timestamp |
toTimestamp(java.time.Instant instant) |
public static com.google.protobuf.Timestamp now(java.time.Clock clock)
public static com.google.protobuf.Timestamp now()
public static com.google.protobuf.Timestamp toTimestamp(java.time.Instant instant)
public static java.time.Instant toInstant(com.google.protobuf.Timestamp timestamp)
public static java.lang.String fullMetricName(java.lang.String domain, java.lang.String group, java.lang.String name)
io.confluent.kafka.server
io.confluent.kafka.producer/request_metrics/produce_request_time_ms
public static java.lang.String convertCase(java.lang.String raw)
Kafka metrics have tags/name with dashes and Yammer metrics have tags/name in camelcase.
raw
- public static java.util.Map<java.lang.String,java.lang.String> cleanLabelNames(java.util.Map<java.lang.String,java.lang.String> raw)
raw
- the input map