Search in sources :

Example 26 with MetricGroup

use of org.apache.kafka.connect.runtime.ConnectMetrics.MetricGroup in project kafka by apache.

the class WorkerSinkTaskTest method assertTaskMetricValue.

private void assertTaskMetricValue(String name, String expected) {
    MetricGroup taskGroup = workerTask.taskMetricsGroup().metricGroup();
    String measured = metrics.currentMetricValueAsString(taskGroup, name);
    assertEquals(expected, measured);
}
Also used : MetricGroup(org.apache.kafka.connect.runtime.ConnectMetrics.MetricGroup)

Example 27 with MetricGroup

use of org.apache.kafka.connect.runtime.ConnectMetrics.MetricGroup in project kafka by apache.

the class WorkerSinkTaskTest method assertSinkMetricValue.

private void assertSinkMetricValue(String name, double expected) {
    MetricGroup sinkTaskGroup = workerTask.sinkTaskMetricsGroup().metricGroup();
    double measured = metrics.currentMetricValueAsDouble(sinkTaskGroup, name);
    assertEquals(expected, measured, 0.001d);
}
Also used : MetricGroup(org.apache.kafka.connect.runtime.ConnectMetrics.MetricGroup)

Example 28 with MetricGroup

use of org.apache.kafka.connect.runtime.ConnectMetrics.MetricGroup in project kafka by apache.

the class WorkerSinkTaskTest method assertTaskMetricValue.

private void assertTaskMetricValue(String name, double expected) {
    MetricGroup taskGroup = workerTask.taskMetricsGroup().metricGroup();
    double measured = metrics.currentMetricValueAsDouble(taskGroup, name);
    assertEquals(expected, measured, 0.001d);
}
Also used : MetricGroup(org.apache.kafka.connect.runtime.ConnectMetrics.MetricGroup)

Example 29 with MetricGroup

use of org.apache.kafka.connect.runtime.ConnectMetrics.MetricGroup in project kafka by apache.

the class WorkerSinkTaskTest method sinkMetricValue.

private double sinkMetricValue(String metricName) {
    MetricGroup sinkTaskGroup = workerTask.sinkTaskMetricsGroup().metricGroup();
    double value = metrics.currentMetricValueAsDouble(sinkTaskGroup, metricName);
    System.out.println("** " + metricName + "=" + value);
    return value;
}
Also used : MetricGroup(org.apache.kafka.connect.runtime.ConnectMetrics.MetricGroup)

Aggregations

MetricGroup (org.apache.kafka.connect.runtime.ConnectMetrics.MetricGroup)29 Test (org.junit.Test)4 Sensor (org.apache.kafka.common.metrics.Sensor)2 Avg (org.apache.kafka.common.metrics.stats.Avg)2 Max (org.apache.kafka.common.metrics.stats.Max)2 HerderMetrics (org.apache.kafka.connect.runtime.distributed.DistributedHerder.HerderMetrics)2