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

Guozhang Wang commented on KAFKA-1359:
--------------------------------------

After reading around on the web it seems to me that nanoTime is more expensive 
than currentTimeMillis.

For elapsed time measurement, currently the timestamp is only used in three 
places:

1) Sample.isComplete: now - lastWindow >= config.timeWindowNs

2) SampledState.purgeObsoleteSamples(): now - sample.lastWindow >= expireAge

3) Possibly used on future SampledStat's update/combine functions, currently 
none of them used the "now" timestamp.

With these use cases I think most measured time spans are large enough for 
milliseconds.

Another issue I saw is that currently the record() call expose the timestamp 
input parameter, while the measure() call used the System.nanoTime internally. 
And we require these two granularities (one used internally and another passed 
in by users) be consistent. I would prefer to have both of them not exposed to 
users. If people agree I can go ahead and make these changes.

> Add topic/broker metrics once new topic/broker is discovered
> ------------------------------------------------------------
>
>                 Key: KAFKA-1359
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1359
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: producer 
>            Reporter: Guozhang Wang
>            Assignee: Guozhang Wang
>             Fix For: 0.8.2
>
>         Attachments: KAFKA-1359.patch, KAFKA-1359_2014-04-10_10:11:40.patch, 
> KAFKA-1359_2014-04-11_14:20:45.patch, KAFKA-1359_2014-04-16_09:53:55.patch
>
>
> Today some topic/broker level metrics are only added the first time such an 
> event (record-retry, record-error, etc) happens. This has a potential issue 
> for customized mbean reporter which needs to register all the sensors at the 
> time the new broker/topic is discovered. It is better to add such metrics at 
> the very beginning when new topic/brokers are discovered.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to