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.ZonedDateTime |
nowInUTC() |
static java.time.ZonedDateTime |
nowInUTC(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.time.ZonedDateTime nowInUTC(java.time.Clock clock)
public static java.time.ZonedDateTime nowInUTC()
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 in lower case separated by hyphens. Eg: total-errors Yammer metrics have tags/name in upper camelcase. Eg: TotalErrors Some KSQL metrics have weird casing where the metric name is a mix of upper case words separated by underscore along with lower case words separated by hyphen. Eg: PENDING_SHUTDOWN-queries
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