@@ -208,35 +208,39 @@ print_build_caching_leverage_metrics() {
208
208
}
209
209
210
210
print_avoided_cacheable_tasks () {
211
- local value task_count_padding= " $1 "
211
+ local value
212
212
if [[ -n " ${avoided_from_cache_num_tasks[1]} " && -n " ${avoided_from_cache_avoidance_savings[1]} " ]]; then
213
- local task_count
214
- task_count=" $( printf " %${task_count_padding} s" " ${avoided_from_cache_num_tasks[1]} " ) "
215
- value=" ${task_count} ${BUILD_TOOL_TASK} s, ${avoided_from_cache_avoidance_savings[1]} total saved execution time"
213
+ printf -v value " %$1 s %ss, %s total saved execution time" \
214
+ " ${avoided_from_cache_num_tasks[1]} " \
215
+ " ${BUILD_TOOL_TASK} " \
216
+ " $( format_duration avoided_from_cache_avoidance_savings[1]) "
216
217
fi
217
218
summary_row " Avoided cacheable ${BUILD_TOOL_TASK} s:" " ${value} "
218
219
}
219
220
220
221
print_executed_cacheable_tasks () {
221
- local value task_count_padding= " $1 "
222
+ local value
222
223
if [[ -n " ${executed_cacheable_num_tasks[1]} " && -n " ${executed_cacheable_duration[1]} " ]]; then
223
- local summary_color task_count
224
+ local summary_color
224
225
if (( executed_cacheable_num_tasks[1 ] > 0 )) ; then
225
226
summary_color=" ${WARN_COLOR} "
226
227
fi
227
228
228
- task_count=" $( printf " %${task_count_padding} s" " ${executed_cacheable_num_tasks[1]} " ) "
229
- value=" ${summary_color}${task_count} ${BUILD_TOOL_TASK} s, ${executed_cacheable_duration[1]} total execution time${RESTORE} "
229
+ printf -v value " ${summary_color} %$1 s %ss, %s total execution time${RESTORE} " \
230
+ " ${executed_cacheable_num_tasks[1]} " \
231
+ " ${BUILD_TOOL_TASK} " \
232
+ " $( format_duration executed_cacheable_duration[1]) "
230
233
fi
231
234
summary_row " Executed cacheable ${BUILD_TOOL_TASK} s:" " ${value} "
232
235
}
233
236
234
237
print_executed_non_cacheable_tasks () {
235
- local value task_count_padding= " $1 "
238
+ local value
236
239
if [[ -n " ${executed_not_cacheable_num_tasks[1]} " && -n " ${executed_not_cacheable_duration[1]} " ]]; then
237
- local task_count
238
- task_count=" $( printf " %${task_count_padding} s" " ${executed_not_cacheable_num_tasks[1]} " ) "
239
- value=" ${task_count} ${BUILD_TOOL_TASK} s, ${executed_not_cacheable_duration[1]} total execution time"
240
+ printf -v value " %$1 s %ss, %s total execution time" \
241
+ " ${executed_not_cacheable_num_tasks[1]} " \
242
+ " ${BUILD_TOOL_TASK} " \
243
+ " $( format_duration executed_not_cacheable_duration[1]) "
240
244
fi
241
245
summary_row " Executed non-cacheable ${BUILD_TOOL_TASK} s:" " ${value} "
242
246
}
0 commit comments