Include bazel-status of build in metrics
Currently within metrics we cannot distinguish between Bazel-involved
configurations:
Bazel as Ninja vs Ninja as Ninja builds
Bazel mixed builds vs non-mixed builds
Add these to the build configuration in order to distinguish between and
track them independently.
Test: go soong tests
Test: USE_BAZEL_ANALYSIS=1 m nothing and verify out/soong_metrics
Bug: 193672397
Change-Id: I94ce56c1a98a76d929598d9fe3070df16ffa1376
diff --git a/ui/build/config.go b/ui/build/config.go
index 7370627..cd6d549 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -345,12 +345,7 @@
return
}
- b := &smpb.BuildConfig{
- ForceUseGoma: proto.Bool(config.ForceUseGoma()),
- UseGoma: proto.Bool(config.UseGoma()),
- UseRbe: proto.Bool(config.UseRBE()),
- }
- ctx.Metrics.BuildConfig(b)
+ ctx.Metrics.BuildConfig(buildConfig(config))
s := &smpb.SystemResourceInfo{
TotalPhysicalMemory: proto.Uint64(config.TotalRAM()),
@@ -359,6 +354,16 @@
ctx.Metrics.SystemResourceInfo(s)
}
+func buildConfig(config Config) *smpb.BuildConfig {
+ return &smpb.BuildConfig{
+ ForceUseGoma: proto.Bool(config.ForceUseGoma()),
+ UseGoma: proto.Bool(config.UseGoma()),
+ UseRbe: proto.Bool(config.UseRBE()),
+ BazelAsNinja: proto.Bool(config.UseBazel()),
+ BazelMixedBuild: proto.Bool(config.bazelBuildMode() == mixedBuild),
+ }
+}
+
// getConfigArgs processes the command arguments based on the build action and creates a set of new
// arguments to be accepted by Config.
func getConfigArgs(action BuildAction, dir string, ctx Context, args []string) []string {