metrics: Improve naming testing containers in launch times test

This commit provides a new way to name the containers used
in the launch-times-test in this form:
'kata_launch_times_RANDOM_NUMBER', where RANDOM_NUMBER is
in the 0-1000 range.

Fixes: #7529

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
This commit is contained in:
David Esparza 2023-08-02 12:23:09 -06:00
parent 5dbe88330f
commit 1e15369e59
No known key found for this signature in database
GPG Key ID: EABE0B1A98CC3B7A

View File

@ -96,6 +96,7 @@ run_workload() {
# number of decimal digits after the decimal points
# for 'bc' performing math in kernel period estimation
L_CALC_SCALE=13
local CONTAINER_NAME="kata_launch_times_$(( $RANDOM % 1000 + 1))"
start_time=$($DATECMD)
# Check entropy level of the host
@ -103,8 +104,7 @@ run_workload() {
# Run the image and command and capture the results into an array...
declare workload_result
readarray -n 0 workload_result < <(sudo -E "${CTR_EXE}" run --rm --runtime=${CTR_RUNTIME} ${IMAGE} test bash -c "$DATECMD $DMESGCMD")
readarray -n 0 workload_result < <(sudo -E "${CTR_EXE}" run --rm --runtime ${CTR_RUNTIME} ${IMAGE} ${CONTAINER_NAME} bash -c "$DATECMD $DMESGCMD")
end_time=$($DATECMD)
# Delay this calculation until after we have run - do not want