Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.

Status

Current state: "Under Discussion" Accepted (1.0.0)

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: KAFKA-5738

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

...

outgoing-byte-rateoutgoing-byte-total
request-totalraterequest-total
incoming-byte-rateincoming-byte-total
response-rateresponse-total

...

[put | put-if-absent | get | delete | put-all | all | range | flush | restore]-rate[put | put-if-absent | get | delete | put-all | all | range | flush | restore]-total


Proposed Changes

A new Stat named org.apache.kafka.common.metrics.stats.RateMeter will be added which will be converted to a CompoundStat similar to Percentiles, with two metrics: rate and total (e.g. request-rate and request-total). For consistency, metrics like io-wait-ratio which specify time ratio will also have two attributes (e.g. io-wait-ratio and io-wait-time-total).

Example:

Code Block
languagejava
titleCreating Rate Metrics
rateMetricName = metrics.metricName("request-rate", metricGrpName, "The average number of requests sent per second.", metricTags);
totalMetricName = metrics.metricName("request-total", metricGrpName, "The total number of requests sent.", metricTags);
this.bytesSent.add(new Meter(new Count(), rateMetricName, totalMetricName));

 

Meter would be a CompoundStat that returns both total and the existing rate metrics. This is already handled correctly to support Percentiles. The two metrics appear as two Attributes.

Code Block
languagejava
titleMetrics from Meter as a CompoundStat
 @Override
 public List<NamedMeasurable> stats() {
    List<NamedMeasurable> stats = new ArrayList<NamedMeasurable>(2);
    stats.add(new NamedMeasurable(totalMetricName, total));
    stats.add(new NamedMeasurable(rateMetricName, rate));
    return stats;
}

 

Compatibility, Deprecation, and Migration Plan

...