public class MetricsUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_MAX |
static 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,
String name,
Map<String,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,
String attribute)
Convert a Yammer metric to a CruiseControlMetric
|
static Map<String,String> |
yammerMetricScopeToTags(String scope)
Convert a yammer metrics scope to a tags map.
|
public static final String ATTRIBUTE_MEAN
public static final 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, 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 Map<String,String> yammerMetricScopeToTags(String scope)
public static CruiseControlMetric toCruiseControlMetric(long now, int brokerId, String name, Map<String,String> tags, double value)