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

ASF GitHub Bot commented on HDFS-16971:
---------------------------------------

melissayou commented on code in PR #5536:
URL: https://github.com/apache/hadoop/pull/5536#discussion_r1164453134


##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileSystemStorageStatistics.java:
##########
@@ -74,6 +75,7 @@ public void setup() {
     statistics.incrementBytesReadByDistance(1, RandomUtils.nextInt(0, 100));
     statistics.incrementBytesReadByDistance(3, RandomUtils.nextInt(0, 100));
     statistics.incrementBytesReadErasureCoded(RandomUtils.nextInt(0, 100));
+    statistics.increaseRemoteBytesReadTime(RandomUtils.nextInt(0, 100));

Review Comment:
   The existing test method `testGetLongStatistics` and `testGetLong` applies 
to any newly added field as well. While running this test locally, I can see 
assertion results like below
   
   ```
   2023-04-12 10:37:10,362 INFO  fs.TestFileSystemStorageStatistics 
(TestFileSystemStorageStatistics.java:testGetLong(99)) - remoteReadTimeMS: 
FileSystem.Statistics=75, FileSystemStorageStatistics=75
   
   2023-04-12 10:37:10,353 INFO  fs.TestFileSystemStorageStatistics 
(TestFileSystemStorageStatistics.java:testGetLongStatistics(88)) - 
remoteReadTimeMS: FileSystem.Statistics=10, FileSystemStorageStatistics=10
   ```





> Add read time metrics for remote reads in Statistics
> ----------------------------------------------------
>
>                 Key: HDFS-16971
>                 URL: https://issues.apache.org/jira/browse/HDFS-16971
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs
>            Reporter: Melissa You
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 3.3.0, 3.4.0
>
>
> In Filesystem.java, currently it only collects bytes read not the 
> corresponding timing of reads.
> In particular, we're interested in time spent on remote reads(not local 
> reads). Adding timing info will help us understand it better and further 
> analyze how locality of DN behaves. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to