Andrew Wang commented on HDFS-10872:

Thanks for working on this folks, and sorry for coming to this review late. I 
have a few comments looking at this patch:

* I'd prefer we use try/finally to do the lock/unlocks in aggregateMetrics for 
* We're doing the thread-local increment and aggregate outside of the metrics 
system right now. Did we look into making the metrics classes themselves 
multi-threading friendly? Then we could more easily reuse this code in other 
* Related, the aggregation right now is done periodically on increment. I think 
what we'd really like is aggregate-on-read. The metrics classes support this 
via {{setChanged}} and {{snapshot}}. Otherwise, occasionally one operation is 
getting hit with the penalty of aggregating all the metrics, and possibly for 
no reason if it's not being read.

I might have mentioned this before, but the 
 code in JDK8 is basically what I'm thinking of, and the performance is quite 
good. The license is friendly, so we could copy-paste this into Hadoop for the 
branch-2's, and use the built-in JDK8 version for trunk.

> Add MutableRate metrics for FSNamesystemLock operations
> -------------------------------------------------------
>                 Key: HDFS-10872
>                 URL: https://issues.apache.org/jira/browse/HDFS-10872
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: namenode
>            Reporter: Erik Krogen
>            Assignee: Erik Krogen
>         Attachments: FSLockPerf.java, HDFS-10872.000.patch, 
> HDFS-10872.001.patch, HDFS-10872.002.patch, HDFS-10872.003.patch, 
> HDFS-10872.004.patch
> Add metrics for FSNamesystemLock operations to see, overall, how long each 
> operation is holding the lock for. Use MutableRate metrics for now. 

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to