diff options
author | 2016-06-14 15:39:51 +0000 | |
---|---|---|
committer | 2016-06-15 08:37:45 +0000 | |
commit | e9b41c66cd147fa5567b70260367c59b7392cfa4 (patch) | |
tree | e0bafbd5e20776acb99ecfd9909367855768a22d /src | |
parent | 4352dd23ba08357349df321a98bc2546d4094415 (diff) |
Fix action cache save save time reporting: We were giving the time in nanos and saying it was in ms.
--
MOS_MIGRATED_REVID=124841976
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java index 9724a35904..9fb061587a 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java @@ -13,6 +13,9 @@ // limitations under the License. package com.google.devtools.build.lib.buildtool; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.NANOSECONDS; + import com.google.common.base.Joiner; import com.google.common.base.Predicate; import com.google.common.base.Stopwatch; @@ -103,7 +106,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; import java.util.UUID; -import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; @@ -641,7 +643,7 @@ public class ExecutionTool { } } env.getEventBus().post( - new ExecutionPhaseCompleteEvent(timer.stop().elapsed(TimeUnit.MILLISECONDS))); + new ExecutionPhaseCompleteEvent(timer.stop().elapsed(MILLISECONDS))); return successfulTargets; } @@ -716,7 +718,7 @@ public class ExecutionTool { */ private void saveCaches(ActionCache actionCache) { long actionCacheSizeInBytes = 0; - long actionCacheSaveTime; + long actionCacheSaveTimeInMs; AutoProfiler p = AutoProfiler.profiledAndLogged("Saving action cache", ProfilerTask.INFO, LOG); try { @@ -724,10 +726,11 @@ public class ExecutionTool { } catch (IOException e) { getReporter().handle(Event.error("I/O error while writing action log: " + e.getMessage())); } finally { - actionCacheSaveTime = p.completeAndGetElapsedTimeNanos(); + actionCacheSaveTimeInMs = + MILLISECONDS.convert(p.completeAndGetElapsedTimeNanos(), NANOSECONDS); } env.getEventBus().post(new CachesSavedEvent( - actionCacheSaveTime, actionCacheSizeInBytes)); + actionCacheSaveTimeInMs, actionCacheSizeInBytes)); } private ActionInputFileCache createBuildSingleFileCache(Path execRoot) { |