Add tracer to runBazel function.

Added a tracer named "bazel" in runBazel function to capture topline
metrics when running bazel.

Bug: b/173028918
Test: * USE_BAZEL=1 m nothing and checked soong_metrics file using
        printproto command to verify that bazel topline metrics
	were captured.
Change-Id: I5cb0728a4da48545dc701cc79627c318d5d9a29d
This commit is contained in:
Patrice Arruda
2020-11-13 13:04:17 -08:00
parent 18cb70d645
commit b7cf9ba175
4 changed files with 111 additions and 91 deletions

View File

@@ -32,6 +32,7 @@ const (
RunSetupTool = "setup"
RunShutdownTool = "shutdown"
RunSoong = "soong"
RunBazel = "bazel"
TestRun = "test"
Total = "total"
)
@@ -57,6 +58,8 @@ func (m *Metrics) SetTimeMetrics(perf soong_metrics_proto.PerfInfo) {
case RunSoong:
m.metrics.SoongRuns = append(m.metrics.SoongRuns, &perf)
break
case RunBazel:
m.metrics.BazelRuns = append(m.metrics.BazelRuns, &perf)
case PrimaryNinja:
m.metrics.NinjaRuns = append(m.metrics.NinjaRuns, &perf)
break