This is an automated email from the ASF dual-hosted git repository.

zhouky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 34e6c1919 [CELEBORN-1042] Calculate duration using nanotime in 
CelebornInputStream
34e6c1919 is described below

commit 34e6c19192f387596cdd8e9544c3a5fa5b2d5f1c
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]>
---
 .../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 6c797338d..996dd6e9e 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
@@ -539,7 +539,7 @@ public abstract class CelebornInputStream extends 
InputStream {
         return false;
       }
 
-      long startTime = System.currentTimeMillis();
+      long startTime = System.nanoTime();
 
       boolean hasData = false;
       while (currentChunk.isReadable() || moveToNextChunk()) {
@@ -599,7 +599,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;
     }

Reply via email to