Add critical path infomation into metrics

To improve build efficiency, the metrics for critical path and
parallelism ratio is necessary. That information has been included in
soong.log, so added it into metrics as well.

Bug: 271526845
Test: build and check if metrics pb has critical path info
Change-Id: I14e1a78c13d400b792d3b05df18604da48759ade
diff --git a/ui/metrics/metrics_proto/metrics.proto b/ui/metrics/metrics_proto/metrics.proto
index b7dc91a..2fc9e09 100644
--- a/ui/metrics/metrics_proto/metrics.proto
+++ b/ui/metrics/metrics_proto/metrics.proto
@@ -128,6 +128,9 @@
   // The branch on which the build occurred.
   // Example: refs/heads/master
   optional string branch = 32;
+
+  // The metric of critical path in build
+  optional CriticalPathInfo critical_path_info = 33;
 }
 
 message BuildConfig {
@@ -314,3 +317,19 @@
   // Modules that are not enabled for MixedBuilds
   repeated string mixed_build_disabled_modules = 2;
 }
+
+message CriticalPathInfo{
+  // Real time which the build system spent
+  optional uint64 elapsed_time = 1;
+  // The sum of execution time of the longest path from leave to the root
+  optional uint64 critical_path_time = 2;
+  // Detailed job information in a critical path.
+  repeated JobInfo critical_path = 4;
+}
+
+message JobInfo{
+  // Real time which a job spent
+  optional uint64 elapsed_time = 1;
+  // Description of a job
+  optional string job_description = 2;
+}