Merge "Revert "init: warn slow action"" am: 431c489568

am: ea516950fb

Change-Id: I0839b87695043ce0efbf921ffd94364091991b65
This commit is contained in:
Nick Desaulniers 2016-11-15 07:12:41 +00:00 committed by android-build-merger
commit 6133e64575
1 changed files with 3 additions and 5 deletions

View File

@ -118,16 +118,14 @@ void Action::ExecuteCommand(const Command& command) const {
Timer t;
int result = command.InvokeFunc();
double duration_ms = t.duration() * 1000;
// Any action longer than 50ms will be warned to user as slow operation
if (duration_ms > 50.0 ||
android::base::GetMinimumLogSeverity() <= android::base::DEBUG) {
// TODO: this should probably be changed to "if (failed || took a long time)"...
if (android::base::GetMinimumLogSeverity() <= android::base::DEBUG) {
std::string trigger_name = BuildTriggersString();
std::string cmd_str = command.BuildCommandString();
std::string source = command.BuildSourceString();
LOG(INFO) << "Command '" << cmd_str << "' action=" << trigger_name << source
<< " returned " << result << " took " << duration_ms << "ms.";
<< " returned " << result << " took " << t.duration() << "s";
}
}