You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jun Rao (JIRA)" <ji...@apache.org> on 2016/06/20 22:34:57 UTC

[jira] [Commented] (KAFKA-3868) New producer metric record-size-avg does not provide average record size as advertised

    [ https://issues.apache.org/jira/browse/KAFKA-3868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15340565#comment-15340565 ] 

Jun Rao commented on KAFKA-3868:
--------------------------------

One caveat is that record() requires synchronization. So, calling it once on a batch of records is more efficient. https://issues.apache.org/jira/browse/KAFKA-3769 reported some overhead related to metric recording.

> New producer metric record-size-avg does not provide average record size as advertised
> --------------------------------------------------------------------------------------
>
>                 Key: KAFKA-3868
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3868
>             Project: Kafka
>          Issue Type: Bug
>          Components: producer 
>    Affects Versions: 0.10.0.0
>            Reporter: Ewen Cheslack-Postava
>            Assignee: Liquan Pei
>
> The metrics for record size are setup as such:
> {code}
>             this.maxRecordSizeSensor = metrics.sensor("record-size-max");
>             m = metrics.metricName("record-size-max", metricGrpName, "The maximum record size");
>             this.maxRecordSizeSensor.add(m, new Max());
>             m = metrics.metricName("record-size-avg", metricGrpName, "The average record size");
>             this.maxRecordSizeSensor.add(m, new Avg());
> {code}
> and then the values are recorded:
> {code}
> this.maxRecordSizeSensor.record(batch.maxRecordSize, now);
> {code}
> So the value provided by record-size-avg is the average maximum record size with the average computed by batch, not the average size of the records being sent as is suggested by "The average record size". We have all the necessary info needed to compute the metric, but it needs to be done separately from recording the batch.maxRecordSize values.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)