Add more profile spans to close gaps in the `aquery` profile.
Closes
@@ -17,6 +17,8 @@ import com.google.devtools.build.lib.actions.CommandLineExpansionException;
import com.google.devtools.build.lib.analysis.AspectValue;
import com.google.devtools.build.lib.analysis.ConfiguredTargetValue;
import com.google.devtools.build.lib.events.ExtendedEventHandler;
+import com.google.devtools.build.lib.profiler.Profiler;
+import com.google.devtools.build.lib.profiler.SilentCloseable;
import com.google.devtools.build.lib.query2.engine.QueryEnvironment.TargetAccessor;
import com.google.devtools.build.lib.skyframe.RuleConfiguredTargetValue;
import com.google.devtools.build.lib.skyframe.SkyframeExecutor;
@@ -88,7 +90,7 @@ public class ActionGraphProtoOutputFormatterCallback extends AqueryThreadsafeCal
@Override
public void processOutput(Iterable<ConfiguredTargetValue> partialResult)
throws IOException, InterruptedException {
- try {
+ try (SilentCloseable c = Profiler.instance().profile("process partial result")) {
// Enabling includeParamFiles should enable includeCommandline by default.
options.includeCommandline |= options.includeParamFiles;
@@ -113,7 +115,9 @@ public class ActionGraphProtoOutputFormatterCallback extends AqueryThreadsafeCal
@Override
public void close(boolean failFast) throws IOException {
if (!failFast) {
+ try (SilentCloseable c = Profiler.instance().profile("aqueryOutputHandler.close")) {
aqueryOutputHandler.close();
}
}
}
+}
