goiri commented on code in PR #5536:
URL: https://github.com/apache/hadoop/pull/5536#discussion_r1163407205
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java:
##########
@@ -4252,6 +4259,14 @@ public void incrementBytesReadByDistance(int distance,
long newBytes) {
}
}
+ /**
+ * Increment the time taken to read bytes from remote in the statistics.
+ * @param duration time taken in ms to read bytes from remote
+ */
+ public void increaseRemoteBytesReadTime(long duration) {
Review Comment:
`final long durationMs`
##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java:
##########
@@ -3090,10 +3090,14 @@ public Peer newConnectedPeer(InetSocketAddress addr,
}
}
- void updateFileSystemReadStats(int distance, int nRead) {
+ void updateFileSystemReadStats(int distance, int nRead, long readTimeMS) {
Review Comment:
As we are at it, `readBytes`?
##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/StripeReader.java:
##########
@@ -351,9 +351,12 @@ void readStripe() throws IOException {
// first read failure
while (!futures.isEmpty()) {
try {
+ long beginRead = Time.monotonicNow();
Review Comment:
`beginReadMs`?
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java:
##########
@@ -3942,6 +3942,7 @@ public static class StatisticsData {
private volatile long bytesReadDistanceOfThreeOrFour;
private volatile long bytesReadDistanceOfFiveOrLarger;
private volatile long bytesReadErasureCoded;
+ private volatile long remoteBytesReadTimeMS;
Review Comment:
I'm not sure "Bytes" makes sense in the name.
`remoteReadTimeMS`?
##########
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:
Can we assert something?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]