public class MetricsUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTRIBUTE_MAX |
static java.lang.String |
ATTRIBUTE_MEAN |
Modifier and Type | Method and Description |
---|---|
static BrokerMetric |
getCpuMetric(long now,
int brokerId)
Returns the "recent CPU usage" for the JVM process as a double in [0.0,1.0].
|
static boolean |
isInterested(org.apache.kafka.common.MetricName metricName)
Check if a kafkaMetric is an interested metric.
|
static boolean |
isInterested(YammerMetricWrapper metricWrapper)
Check if a yammer metric name is an interested metric
|
static CruiseControlMetric |
toCruiseControlMetric(org.apache.kafka.common.metrics.KafkaMetric kafkaMetric,
long now,
int brokerId)
Convert a KafkaMetric to a CruiseControlMetric
|
static CruiseControlMetric |
toCruiseControlMetric(long now,
int brokerId,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> tags,
double value)
build a CruiseControlMetric object.
|
static CruiseControlMetric |
toCruiseControlMetric(long now,
int brokerId,
YammerMetricWrapper metricWrapper,
double value)
Convert a Yammer metric to a CruiseControlMetric
|
static CruiseControlMetric |
toCruiseControlMetric(long now,
int brokerId,
YammerMetricWrapper metricWrapper,
double value,
java.lang.String attribute)
Convert a Yammer metric to a CruiseControlMetric
|
static java.util.Map<java.lang.String,java.lang.String> |
yammerMetricScopeToTags(java.lang.String scope)
Convert a yammer metrics scope to a tags map.
|
public static final java.lang.String ATTRIBUTE_MEAN
public static final java.lang.String ATTRIBUTE_MAX
public static CruiseControlMetric toCruiseControlMetric(org.apache.kafka.common.metrics.KafkaMetric kafkaMetric, long now, int brokerId)
public static CruiseControlMetric toCruiseControlMetric(long now, int brokerId, YammerMetricWrapper metricWrapper, double value)
public static CruiseControlMetric toCruiseControlMetric(long now, int brokerId, YammerMetricWrapper metricWrapper, double value, java.lang.String attribute)
public static BrokerMetric getCpuMetric(long now, int brokerId)
public static boolean isInterested(org.apache.kafka.common.MetricName metricName)
public static boolean isInterested(YammerMetricWrapper metricWrapper)
public static java.util.Map<java.lang.String,java.lang.String> yammerMetricScopeToTags(java.lang.String scope)
public static CruiseControlMetric toCruiseControlMetric(long now, int brokerId, java.lang.String name, java.util.Map<java.lang.String,java.lang.String> tags, double value)