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

Chen Liang commented on HDFS-12332:
-----------------------------------

Thanks [~xzhao9] for the improvement. One thought, "Updating max value as X" 
might not be that useful because it does not say what this value is about. i.e. 
a more informative output might be something like "Updating the max value of 
metric X from Y to Z". Not sure whether this can be easily done though because 
SampleStat seems to be a generic utility class and may not be able to know what 
is the "metric X" part.

Also it's possible this can be quite noisy, in which we may want to add some 
throttling checks. Lastly, seems to me that {{LOG.trace}} is probably more 
suitable than {{LOG.debug}} here.

> Logging improvement suggestion for SampleStat function MinMax.add
> -----------------------------------------------------------------
>
>                 Key: HDFS-12332
>                 URL: https://issues.apache.org/jira/browse/HDFS-12332
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: metrics
>    Affects Versions: 3.0.0-alpha4
>            Reporter: Xu Zhao
>            Priority: Minor
>         Attachments: hdfs-12332.patch
>
>
> In order to debug performance anomlies, it is better to see when the max and 
> min value get updated in metrics.
> For example, in our workload we would like to see the longest latency of a 
> write block request on DataNode.
> The following metric updating code could possibly update the min/max value in 
> SampleStat class:
> {code:java}
>     datanode.getMetrics().addWriteBlockOp(elapsed());
>     datanode.getMetrics().incrWritesFromClient(peer.isLocal(), size);
> {code}
> Here I am attaching an attempt to patch it.
> The patch just adds additional DEBUG level logging in the MinMax class and 
> prints the new value when it gets updated.
> Please let me know what you think. For example, if this patch would introduce 
> too much noises, what is the best way to trace the read/writeBlock that has 
> the minimum/maximum latency?
> Any comments are appreciated!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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