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

Michael Coon commented on KAFKA-3564:
-------------------------------------

If you look at the impl for Count, it only increments by 1.0 each time I call 
record (which calls update of Count from SampleStat). So it will only ever 
increment my count by 1  no matter what I send in as the actual value of 
record. For Total, you'll notice it overrides record and measure methods and 
does NOT reset it's total, ever. 

So if I want messages-in per second, I can't do new Rate(new Count()) because 
it will always only increment its total by 1.0. I have sub-elements of data 
coming into my processors that I want to use for the increment of count. I 
would have to iterate through all of them to increment count for each 
one...wasting cycles. Instead, I want to do something like 
"msgsIn.record(incoming.size())" and be done with it.

If I use new Rate(new Total()), then the total value never changes so the 
"rate" would just keep climbing and climbing forever and not give me the rate 
of messages-in in the last minute, for example.

> Count metric always increments by 1.0
> -------------------------------------
>
>                 Key: KAFKA-3564
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3564
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.10.1.0
>            Reporter: Michael Coon
>            Assignee: Kim Christensen
>
> The Count metric's update method always increments its value by 1.0 instead 
> of the value passed to it. If this is by design, it's misleading as I want to 
> be able to count based on values I send to the record method.



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

Reply via email to