use of org.apache.kafka.common.metrics.KafkaMetric in project ksql by confluentinc.
the class SlidingWindowRateLimiterTest method getRemaining.
private double getRemaining(final Metrics metrics, final Map<String, String> tags) {
final MetricName remainingMetricName = new MetricName(METRIC_PREFIX + "-bandwidth-limit-remaining", "_confluent-ksql-limits", "The current value of the bandwidth limiter", tags);
final KafkaMetric remainingMetric = metrics.metrics().get(remainingMetricName);
return (double) remainingMetric.metricValue();
}
use of org.apache.kafka.common.metrics.KafkaMetric in project ksql by confluentinc.
the class SlidingWindowRateLimiterTest method getReject.
private double getReject(final Metrics metrics, final Map<String, String> tags) {
final MetricName rejectMetricName = new MetricName(METRIC_PREFIX + "-bandwidth-limit-reject-count", "_confluent-ksql-limits", "The number of requests rejected by this limiter", tags);
final KafkaMetric rejectMetric = metrics.metrics().get(rejectMetricName);
return (double) rejectMetric.metricValue();
}
use of org.apache.kafka.common.metrics.KafkaMetric in project ksql by confluentinc.
the class ConcurrencyLimiterTest method getReject.
private double getReject(final Metrics metrics, final Map<String, String> tags) {
final MetricName rejectMetricName = new MetricName("pull-concurrency-limit-reject-count", "_confluent-ksql-limits", "The number of requests rejected by this limiter", tags);
final KafkaMetric rejectMetric = metrics.metrics().get(rejectMetricName);
return (double) rejectMetric.metricValue();
}
use of org.apache.kafka.common.metrics.KafkaMetric in project ksql by confluentinc.
the class RateLimiterTest method getReject.
private double getReject(final Metrics metrics, final Map<String, String> tags) {
final MetricName rejectMetricName = new MetricName(METRIC_NAMESPACE + "-rate-limit-reject-count", "_confluent-ksql-limits", "The number of requests rejected by this limiter", tags);
final KafkaMetric rejectMetric = metrics.metrics().get(rejectMetricName);
return (double) rejectMetric.metricValue();
}
use of org.apache.kafka.common.metrics.KafkaMetric in project apache-kafka-on-k8s by banzaicloud.
the class MeteredKeyValueBytesStoreTest method shouldPutAllToInnerStoreAndRecordPutAllMetric.
@SuppressWarnings("unchecked")
@Test
public void shouldPutAllToInnerStoreAndRecordPutAllMetric() {
inner.putAll(EasyMock.anyObject(List.class));
EasyMock.expectLastCall();
init();
metered.putAll(Collections.singletonList(KeyValue.pair(key, value)));
final KafkaMetric metric = metric("put-all-rate");
assertTrue(metric.value() > 0);
EasyMock.verify(inner);
}
Aggregations