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

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 
safety.
* 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 
places.
* 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 
[LongAdder|http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jsr166e/LongAdder.java?view=co]
 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
(v6.3.4#6332)

---------------------------------------------------------------------
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