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

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

One follow-up observation is that we used System.nanoTime the the parameters in 
record() and measure(), while System.nanoTime itself does not necessarily 
represent the current time in nanoseconds, but just the cpu counter in the JVM 
in the granularity of nanoseconds. So when we use it to measure metadata age 
and compare the value with System.currentTimeMillis that will give us 
"undefined" behavior.

In general, for our use case, I think we do not need to use System.nanoTime 
which is mainly for measuring elapsed time in very high accuracy, while we use 
the timestamp mainly for measuring rates, and window boundaries for samples. 
For those I think milliseconds are good enough. [~jkreps] What do you think?

> 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