Search in sources :

Example 1 with PrometheusValue

use of com.linkedin.kafka.cruisecontrol.monitor.sampling.prometheus.model.PrometheusValue in project cruise-control by linkedin.

the class PrometheusMetricSampler method addTopicMetrics.

private int addTopicMetrics(Cluster cluster, RawMetricType metricType, PrometheusQueryResult queryResult) throws InvalidPrometheusResultException {
    int brokerId = getBrokerId(cluster, queryResult);
    String topic = getTopic(queryResult);
    int metricsAdded = 0;
    for (PrometheusValue value : queryResult.values()) {
        addMetricForProcessing(new TopicMetric(metricType, value.epochSeconds() * SEC_TO_MS, brokerId, topic, value.value()));
        metricsAdded++;
    }
    return metricsAdded;
}
Also used : PrometheusValue(com.linkedin.kafka.cruisecontrol.monitor.sampling.prometheus.model.PrometheusValue) TopicMetric(com.linkedin.kafka.cruisecontrol.metricsreporter.metric.TopicMetric)

Example 2 with PrometheusValue

use of com.linkedin.kafka.cruisecontrol.monitor.sampling.prometheus.model.PrometheusValue in project cruise-control by linkedin.

the class PrometheusMetricSampler method addBrokerMetrics.

private int addBrokerMetrics(Cluster cluster, RawMetricType metricType, PrometheusQueryResult queryResult) throws InvalidPrometheusResultException {
    int brokerId = getBrokerId(cluster, queryResult);
    int metricsAdded = 0;
    for (PrometheusValue value : queryResult.values()) {
        addMetricForProcessing(new BrokerMetric(metricType, value.epochSeconds() * SEC_TO_MS, brokerId, value.value()));
        metricsAdded++;
    }
    return metricsAdded;
}
Also used : BrokerMetric(com.linkedin.kafka.cruisecontrol.metricsreporter.metric.BrokerMetric) PrometheusValue(com.linkedin.kafka.cruisecontrol.monitor.sampling.prometheus.model.PrometheusValue)

Example 3 with PrometheusValue

use of com.linkedin.kafka.cruisecontrol.monitor.sampling.prometheus.model.PrometheusValue in project cruise-control by linkedin.

the class PrometheusMetricSampler method addPartitionMetrics.

private int addPartitionMetrics(Cluster cluster, RawMetricType metricType, PrometheusQueryResult queryResult) throws InvalidPrometheusResultException {
    int brokerId = getBrokerId(cluster, queryResult);
    String topic = getTopic(queryResult);
    int partition = getPartition(queryResult);
    int metricsAdded = 0;
    for (PrometheusValue value : queryResult.values()) {
        addMetricForProcessing(new PartitionMetric(metricType, value.epochSeconds() * SEC_TO_MS, brokerId, topic, partition, value.value()));
        metricsAdded++;
    }
    return metricsAdded;
}
Also used : PartitionMetric(com.linkedin.kafka.cruisecontrol.metricsreporter.metric.PartitionMetric) PrometheusValue(com.linkedin.kafka.cruisecontrol.monitor.sampling.prometheus.model.PrometheusValue)

Aggregations

PrometheusValue (com.linkedin.kafka.cruisecontrol.monitor.sampling.prometheus.model.PrometheusValue)3 BrokerMetric (com.linkedin.kafka.cruisecontrol.metricsreporter.metric.BrokerMetric)1 PartitionMetric (com.linkedin.kafka.cruisecontrol.metricsreporter.metric.PartitionMetric)1 TopicMetric (com.linkedin.kafka.cruisecontrol.metricsreporter.metric.TopicMetric)1