aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
diff options
context:
space:
mode:
authorGravatar ulfjack <ulfjack@google.com>2018-06-11 06:00:36 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-11 06:01:34 -0700
commit4cf2ebdcef7b5d4c46e533a560642b89eb3f02a5 (patch)
treecf2b64cf0f82827955cb34ce7b188fc641b946d6 /src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
parentc720152ec1936a537c9519d522d3cb41d19cff77 (diff)
Add AutoProfiler-like API to Profiler
- migrate all startTask/completeTask pairs to the new API PiperOrigin-RevId: 200038703
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java')
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java b/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
index 7771d833ec..9d7bf274f9 100644
--- a/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
+++ b/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
@@ -22,6 +22,7 @@ import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadCompatible;
import com.google.devtools.build.lib.events.ExtendedEventHandler;
import com.google.devtools.build.lib.profiler.Profiler;
import com.google.devtools.build.lib.profiler.ProfilerTask;
+import com.google.devtools.build.lib.profiler.SilentCloseable;
import com.google.devtools.build.lib.util.GroupedList;
import com.google.devtools.build.skyframe.EvaluationProgressReceiver.EvaluationState;
import com.google.devtools.build.skyframe.EvaluationProgressReceiver.EvaluationSuccessState;
@@ -211,11 +212,9 @@ public abstract class AbstractExceptionalParallelEvaluator<E extends Exception>
}
}
- Profiler.instance().startTask(ProfilerTask.SKYFRAME_EVAL, "Parallel Evaluator evaluation");
- try {
+ try (SilentCloseable c =
+ Profiler.instance().profile(ProfilerTask.SKYFRAME_EVAL, "Parallel Evaluator evaluation")) {
return doMutatingEvaluation(skyKeySet);
- } finally {
- Profiler.instance().completeTask(ProfilerTask.SKYFRAME_EVAL);
}
}