Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 1 | // Copyright 2018 Google Inc. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | syntax = "proto2"; |
| 16 | |
Patrice Arruda | 0cc5b21 | 2019-06-14 15:27:46 -0700 | [diff] [blame] | 17 | package soong_build_metrics; |
| 18 | option go_package = "soong_metrics_proto"; |
Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 19 | |
| 20 | message MetricsBase { |
| 21 | // Timestamp generated when the build starts. |
| 22 | optional int64 build_date_timestamp = 1; |
| 23 | |
| 24 | // It is usually used to specify the branch name [and release candidate]. |
| 25 | optional string build_id = 2; |
| 26 | |
| 27 | // The platform version codename, eg. P, Q, REL. |
| 28 | optional string platform_version_codename = 3; |
| 29 | |
| 30 | // The target product information, eg. aosp_arm. |
| 31 | optional string target_product = 4; |
| 32 | |
Patrice Arruda | 0cc5b21 | 2019-06-14 15:27:46 -0700 | [diff] [blame] | 33 | enum BuildVariant { |
Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 34 | USER = 0; |
| 35 | USERDEBUG = 1; |
| 36 | ENG = 2; |
| 37 | } |
| 38 | // The target build variant information, eg. eng. |
Patrice Arruda | 0cc5b21 | 2019-06-14 15:27:46 -0700 | [diff] [blame] | 39 | optional BuildVariant target_build_variant = 5 [default = ENG]; |
Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 40 | |
Patrice Arruda | 0cc5b21 | 2019-06-14 15:27:46 -0700 | [diff] [blame] | 41 | enum Arch { |
Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 42 | UNKNOWN = 0; |
| 43 | ARM = 1; |
| 44 | ARM64 = 2; |
| 45 | X86 = 3; |
| 46 | X86_64 = 4; |
| 47 | } |
| 48 | // The target arch information, eg. arm. |
Patrice Arruda | 0cc5b21 | 2019-06-14 15:27:46 -0700 | [diff] [blame] | 49 | optional Arch target_arch = 6 [default = UNKNOWN]; |
Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 50 | |
| 51 | // The target arch variant information, eg. armv7-a-neon. |
| 52 | optional string target_arch_variant = 7; |
| 53 | |
| 54 | // The target cpu variant information, eg. generic. |
| 55 | optional string target_cpu_variant = 8; |
| 56 | |
| 57 | // The host arch information, eg. x86_64. |
Patrice Arruda | 0cc5b21 | 2019-06-14 15:27:46 -0700 | [diff] [blame] | 58 | optional Arch host_arch = 9 [default = UNKNOWN]; |
Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 59 | |
| 60 | // The host 2nd arch information, eg. x86. |
Patrice Arruda | 0cc5b21 | 2019-06-14 15:27:46 -0700 | [diff] [blame] | 61 | optional Arch host_2nd_arch = 10 [default = UNKNOWN]; |
Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 62 | |
| 63 | // The host os information, eg. linux. |
| 64 | optional string host_os = 11; |
| 65 | |
| 66 | // The host os extra information, eg. Linux-4.17.0-3rodete2-amd64-x86_64-Debian-GNU. |
| 67 | optional string host_os_extra = 12; |
| 68 | |
| 69 | // The host cross os information, eg. windows. |
| 70 | optional string host_cross_os = 13; |
| 71 | |
| 72 | // The host cross arch information, eg. x86. |
| 73 | optional string host_cross_arch = 14; |
| 74 | |
| 75 | // The host cross 2nd arch information, eg. x86_64. |
| 76 | optional string host_cross_2nd_arch = 15; |
| 77 | |
| 78 | // The directory for generated built artifacts installation, eg. out. |
| 79 | optional string out_dir = 16; |
| 80 | |
| 81 | // The metrics for calling various tools (microfactory) before Soong_UI starts. |
| 82 | repeated PerfInfo setup_tools = 17; |
| 83 | |
| 84 | // The metrics for calling Kati by multiple times. |
| 85 | repeated PerfInfo kati_runs = 18; |
| 86 | |
| 87 | // The metrics for calling Soong. |
| 88 | repeated PerfInfo soong_runs = 19; |
| 89 | |
| 90 | // The metrics for calling Ninja. |
| 91 | repeated PerfInfo ninja_runs = 20; |
Colin Cross | 74cda72 | 2020-01-16 15:25:50 -0800 | [diff] [blame^] | 92 | |
| 93 | // The metrics for the whole build |
| 94 | optional PerfInfo total = 21; |
Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | message PerfInfo { |
| 98 | // The description for the phase/action/part while the tool running. |
| 99 | optional string desc = 1; |
| 100 | |
| 101 | // The name for the running phase/action/part. |
| 102 | optional string name = 2; |
| 103 | |
| 104 | // The absolute start time. |
| 105 | // The number of nanoseconds elapsed since January 1, 1970 UTC. |
| 106 | optional uint64 start_time = 3; |
| 107 | |
| 108 | // The real running time. |
| 109 | // The number of nanoseconds elapsed since start_time. |
| 110 | optional uint64 real_time = 4; |
| 111 | |
| 112 | // The number of MB for memory use. |
| 113 | optional uint64 memory_use = 5; |
| 114 | } |
| 115 | |
| 116 | message ModuleTypeInfo { |
Patrice Arruda | 0cc5b21 | 2019-06-14 15:27:46 -0700 | [diff] [blame] | 117 | enum BuildSystem { |
Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 118 | UNKNOWN = 0; |
| 119 | SOONG = 1; |
| 120 | MAKE = 2; |
| 121 | } |
| 122 | // The build system, eg. Soong or Make. |
Patrice Arruda | 0cc5b21 | 2019-06-14 15:27:46 -0700 | [diff] [blame] | 123 | optional BuildSystem build_system = 1 [default = UNKNOWN]; |
Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 124 | |
| 125 | // The module type, eg. java_library, cc_binary, and etc. |
| 126 | optional string module_type = 2; |
| 127 | |
| 128 | // The number of logical modules. |
| 129 | optional uint32 num_of_modules = 3; |
| 130 | } |
Colin Cross | d0be210 | 2019-11-26 16:16:57 -0800 | [diff] [blame] | 131 | |
| 132 | message CriticalUserJourneyMetrics { |
| 133 | // The name of a critical user journey test. |
| 134 | optional string name = 1; |
| 135 | |
| 136 | // The metrics produced when running the critical user journey test. |
| 137 | optional MetricsBase metrics = 2; |
| 138 | } |
| 139 | |
| 140 | message CriticalUserJourneysMetrics { |
| 141 | // A set of metrics from a run of the critical user journey tests. |
| 142 | repeated CriticalUserJourneyMetrics cujs = 1; |
| 143 | } |