summaryrefslogtreecommitdiff
path: root/ui/execution_metrics
diff options
context:
space:
mode:
author LaMont Jones <lamontjones@google.com> 2024-12-16 13:40:10 -0800
committer LaMont Jones <lamontjones@google.com> 2024-12-16 14:05:14 -0800
commit720d7fb1ac749ce12d231c5a76908d5f4947fe22 (patch)
treee8833540408889c3abebf309dbf2772b4d0b11ed /ui/execution_metrics
parentadc0c7dff169bdf97082c20f5a7624455ad19aa5 (diff)
Wrap ExecutionMetrics against future needs
This will allow us to extend ExecutionMetrics in the future. Bug: b/365537477 Test: manual, TH Change-Id: Icfc3d95ee61b19921e23252276a93984baf1f2e1
Diffstat (limited to 'ui/execution_metrics')
-rw-r--r--ui/execution_metrics/execution_metrics.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/ui/execution_metrics/execution_metrics.go b/ui/execution_metrics/execution_metrics.go
index 4ea251fa4..db784495d 100644
--- a/ui/execution_metrics/execution_metrics.go
+++ b/ui/execution_metrics/execution_metrics.go
@@ -204,8 +204,7 @@ func (c *ExecutionMetrics) Dump(path string, args []string) error {
if c.MetricsAggregationDir == "" {
return nil
}
- msg := c.GetMetrics()
- msg.CommandArgs = args
+ msg := c.GetMetrics(args)
if _, err := os.Stat(filepath.Dir(path)); err != nil {
if err = os.MkdirAll(filepath.Dir(path), 0775); err != nil {
@@ -219,7 +218,14 @@ func (c *ExecutionMetrics) Dump(path string, args []string) error {
return os.WriteFile(path, data, 0644)
}
-func (c *ExecutionMetrics) GetMetrics() *soong_metrics_proto.AggregatedFileList {
+func (c *ExecutionMetrics) GetMetrics(args []string) *soong_metrics_proto.ExecutionMetrics {
+ return &soong_metrics_proto.ExecutionMetrics{
+ CommandArgs: args,
+ ChangedFiles: c.getChangedFiles(),
+ }
+}
+
+func (c *ExecutionMetrics) getChangedFiles() *soong_metrics_proto.AggregatedFileList {
fl := c.fileList
if fl == nil {
return nil