From 5ad4e58868bf48a72841bee313fd2aae61b6ddf7 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Thu, 7 Sep 2017 15:33:57 -0700 Subject: [PATCH] Display unaccounted time in "DevStack Component Timing" In the "DevStack Component Timing" section, display the unaccounted time. Also add the units (seconds) to the output to make it clear to viewers. Change-Id: Iaca82cc54a355f7077e20e548b771e53387f6628 --- functions-common | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/functions-common b/functions-common index 4fc7c6db92..f2b8d98b39 100644 --- a/functions-common +++ b/functions-common @@ -2270,11 +2270,13 @@ function cleanup_oscwrap { function time_totals { local elapsed_time local end_time - local len=15 + local len=20 local xtrace + local unaccounted_time end_time=$(date +%s) elapsed_time=$(($end_time - $_TIME_BEGIN)) + unaccounted_time=$elapsed_time # pad 1st column this far for t in ${!_TIME_TOTAL[*]}; do @@ -2291,16 +2293,19 @@ function time_totals { echo echo "=========================" echo "DevStack Component Timing" + echo " (times are in seconds) " echo "=========================" - printf "%-${len}s %3d\n" "Total runtime" "$elapsed_time" - echo for t in ${!_TIME_TOTAL[*]}; do local v=${_TIME_TOTAL[$t]} # because we're recording in milliseconds v=$(($v / 1000)) printf "%-${len}s %3d\n" "$t" "$v" + unaccounted_time=$(($unaccounted_time - $v)) done + echo "-------------------------" + printf "%-${len}s %3d\n" "Unaccounted time" "$unaccounted_time" echo "=========================" + printf "%-${len}s %3d\n" "Total runtime" "$elapsed_time" $xtrace }