This is an automated email from the ASF dual-hosted git repository.
zhouky pushed a commit to branch branch-0.3
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git
The following commit(s) were added to refs/heads/branch-0.3 by this push:
new d795f9587 [CELEBORN-1042] Calculate duration using nanotime in
CelebornInputStream
d795f9587 is described below
commit d795f9587cfde06148f0546877b4be4e2ac99440
Author: sychen <[email protected]>
AuthorDate: Mon Oct 16 19:17:03 2023 +0800
[CELEBORN-1042] Calculate duration using nanotime in CelebornInputStream
### What changes were proposed in this pull request?
### Why are the changes needed?
### Does this PR introduce _any_ user-facing change?
### How was this patch tested?
Closes #1994 from cxzl25/CELEBORN-1042.
Authored-by: sychen <[email protected]>
Signed-off-by: zky.zhoukeyong <[email protected]>
(cherry picked from commit 34e6c19192f387596cdd8e9544c3a5fa5b2d5f1c)
Signed-off-by: zky.zhoukeyong <[email protected]>
---
.../java/org/apache/celeborn/client/read/CelebornInputStream.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/client/src/main/java/org/apache/celeborn/client/read/CelebornInputStream.java
b/client/src/main/java/org/apache/celeborn/client/read/CelebornInputStream.java
index 46d6b2977..8442ff65d 100644
---
a/client/src/main/java/org/apache/celeborn/client/read/CelebornInputStream.java
+++
b/client/src/main/java/org/apache/celeborn/client/read/CelebornInputStream.java
@@ -525,7 +525,7 @@ public abstract class CelebornInputStream extends
InputStream {
return false;
}
- long startTime = System.currentTimeMillis();
+ long startTime = System.nanoTime();
boolean hasData = false;
while (currentChunk.isReadable() || moveToNextChunk()) {
@@ -585,7 +585,7 @@ public abstract class CelebornInputStream extends
InputStream {
}
if (callback != null) {
- callback.incReadTime(System.currentTimeMillis() - startTime);
+ callback.incReadTime(TimeUnit.NANOSECONDS.toMillis(System.nanoTime() -
startTime));
}
return hasData;
}