diff options
author | 2023-05-04 20:40:04 +0000 | |
---|---|---|
committer | 2023-05-04 21:27:34 +0000 | |
commit | d33c2fd5a2a1c8bfcf97a1e9b103232776a73325 (patch) | |
tree | bbc4f30d2447cfa7b5cbb22d858f5b761e2d8a50 /ui/metrics | |
parent | c0bdca91104e72b1435d02e7caf64c4eaef1998d (diff) |
Add --bazel-exit-code parameter to soong_ui.
This is for use in tracking bazel exit codes from b invocations.
Bug: 279754118
Test: b build libcore:all (with prints to verify)
Change-Id: If36b5b73ff93cd15647e5c1c1f676e95137210ff
Diffstat (limited to 'ui/metrics')
-rw-r--r-- | ui/metrics/metrics.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/metrics/metrics.go b/ui/metrics/metrics.go index 82d11ed30..a282e2030 100644 --- a/ui/metrics/metrics.go +++ b/ui/metrics/metrics.go @@ -228,7 +228,7 @@ func (m *Metrics) SetBuildDateTime(buildTimestamp time.Time) { m.metrics.BuildDateTimestamp = proto.Int64(buildTimestamp.UnixNano() / int64(time.Second)) } -func (m *Metrics) UpdateTotalRealTime(data []byte) error { +func (m *Metrics) UpdateTotalRealTimeAndNonZeroExit(data []byte, bazelExitCode int32) error { if err := proto.Unmarshal(data, &m.metrics); err != nil { return fmt.Errorf("Failed to unmarshal proto", err) } @@ -236,6 +236,9 @@ func (m *Metrics) UpdateTotalRealTime(data []byte) error { endTime := uint64(time.Now().UnixNano()) *m.metrics.Total.RealTime = *proto.Uint64(endTime - startTime) + + bazelError := bazelExitCode != 0 + m.metrics.NonZeroExit = proto.Bool(bazelError) return nil } |