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
| ... | ... |
@@ -2270,11 +2270,13 @@ function cleanup_oscwrap {
|
| 2270 | 2270 |
function time_totals {
|
| 2271 | 2271 |
local elapsed_time |
| 2272 | 2272 |
local end_time |
| 2273 |
- local len=15 |
|
| 2273 |
+ local len=20 |
|
| 2274 | 2274 |
local xtrace |
| 2275 |
+ local unaccounted_time |
|
| 2275 | 2276 |
|
| 2276 | 2277 |
end_time=$(date +%s) |
| 2277 | 2278 |
elapsed_time=$(($end_time - $_TIME_BEGIN)) |
| 2279 |
+ unaccounted_time=$elapsed_time |
|
| 2278 | 2280 |
|
| 2279 | 2281 |
# pad 1st column this far |
| 2280 | 2282 |
for t in ${!_TIME_TOTAL[*]}; do
|
| ... | ... |
@@ -2291,16 +2293,19 @@ function time_totals {
|
| 2291 | 2291 |
echo |
| 2292 | 2292 |
echo "=========================" |
| 2293 | 2293 |
echo "DevStack Component Timing" |
| 2294 |
+ echo " (times are in seconds) " |
|
| 2294 | 2295 |
echo "=========================" |
| 2295 |
- printf "%-${len}s %3d\n" "Total runtime" "$elapsed_time"
|
|
| 2296 |
- echo |
|
| 2297 | 2296 |
for t in ${!_TIME_TOTAL[*]}; do
|
| 2298 | 2297 |
local v=${_TIME_TOTAL[$t]}
|
| 2299 | 2298 |
# because we're recording in milliseconds |
| 2300 | 2299 |
v=$(($v / 1000)) |
| 2301 | 2300 |
printf "%-${len}s %3d\n" "$t" "$v"
|
| 2301 |
+ unaccounted_time=$(($unaccounted_time - $v)) |
|
| 2302 | 2302 |
done |
| 2303 |
+ echo "-------------------------" |
|
| 2304 |
+ printf "%-${len}s %3d\n" "Unaccounted time" "$unaccounted_time"
|
|
| 2303 | 2305 |
echo "=========================" |
| 2306 |
+ printf "%-${len}s %3d\n" "Total runtime" "$elapsed_time"
|
|
| 2304 | 2307 |
|
| 2305 | 2308 |
$xtrace |
| 2306 | 2309 |
} |