Skip to content

Commit

Permalink
Log mobile-install times.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 383359331
  • Loading branch information
meisterT authored and Copybara-Service committed Jul 7, 2021
1 parent 14694d1 commit 559db4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -23,6 +23,7 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/analysis:test/test_configuration",
"//src/main/java/com/google/devtools/build/lib/events",
"//src/main/java/com/google/devtools/build/lib/profiler",
"//src/main/java/com/google/devtools/build/lib/profiler:google-auto-profiler-utils",
"//src/main/java/com/google/devtools/build/lib/rules/android",
"//src/main/java/com/google/devtools/build/lib/runtime/commands",
"//src/main/java/com/google/devtools/build/lib/shell",
Expand Down
Expand Up @@ -27,8 +27,9 @@
import com.google.devtools.build.lib.buildtool.BuildResult;
import com.google.devtools.build.lib.buildtool.BuildTool;
import com.google.devtools.build.lib.events.Event;
import com.google.devtools.build.lib.profiler.Profiler;
import com.google.devtools.build.lib.profiler.SilentCloseable;
import com.google.devtools.build.lib.profiler.AutoProfiler;
import com.google.devtools.build.lib.profiler.GoogleAutoProfilerUtils;
import com.google.devtools.build.lib.profiler.ProfilerTask;
import com.google.devtools.build.lib.rules.android.WriteAdbArgsAction;
import com.google.devtools.build.lib.rules.android.WriteAdbArgsAction.StartType;
import com.google.devtools.build.lib.runtime.BlazeCommand;
Expand Down Expand Up @@ -301,7 +302,8 @@ public BlazeCommandResult exec(CommandEnvironment env, OptionsParsingResult opti
.setWorkingDir(workingDir)
.build();

try (SilentCloseable c = Profiler.instance().profile("mobile install")) {
try (AutoProfiler p =
GoogleAutoProfilerUtils.profiledAndLogged("mobile install", ProfilerTask.INFO)) {
// Restore a raw EventHandler if it is registered. This allows for blaze run to produce the
// actual output of the command being run even if --color=no is specified.
env.getReporter().switchToAnsiAllowingHandler();
Expand Down

0 comments on commit 559db4e

Please sign in to comment.