File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -154,16 +154,22 @@ print_performance_characteristics_header() {
154
154
}
155
155
156
156
print_realized_build_time_savings () {
157
- local value
158
- value= " "
157
+ # Do not print realized build time savings at all if these values do not exist
158
+ # This can happen since build-scan-support-tool does not yet support these fields
159
159
if [[ -n " ${effective_task_execution_duration[0]} " && -n " ${effective_task_execution_duration[1]} " ]]; then
160
- local first_build second_build realized_savings
161
- first_build=$( format_duration " ${effective_task_execution_duration[0]} " )
162
- second_build=$( format_duration " ${effective_task_execution_duration[1]} " )
163
- realized_savings=$( format_duration effective_task_execution_duration[0]-effective_task_execution_duration[1])
164
- value=" ${realized_savings} wall-clock time (from ${first_build} to ${second_build} )"
160
+ local value
161
+ value=" "
162
+ # Only calculate realized build time savings when these values are non-zero
163
+ # These values can be returned as zero when an error occurs processing the Build Scan data
164
+ if [[ " ${effective_task_execution_duration[0]} " && " ${effective_task_execution_duration[1]} " ]]; then
165
+ local first_build second_build realized_savings
166
+ first_build=$( format_duration " ${effective_task_execution_duration[0]} " )
167
+ second_build=$( format_duration " ${effective_task_execution_duration[1]} " )
168
+ realized_savings=$( format_duration effective_task_execution_duration[0]-effective_task_execution_duration[1])
169
+ value=" ${realized_savings} wall-clock time (from ${first_build} to ${second_build} )"
170
+ fi
171
+ summary_row " Realized build time savings:" " ${value} "
165
172
fi
166
- summary_row " Realized build time savings:" " ${value} "
167
173
}
168
174
169
175
print_build_caching_leverage_metrics () {
You can’t perform that action at this time.
0 commit comments