metrics: Add function to memory inside container script

This PR adds function before function of the variables at the memory
inside container script in order to have uniformity across the script.

Fixes #7386

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
Gabriela Cervantes 2023-07-19 15:57:33 +00:00
parent 7153b51578
commit 8430068058

View File

@ -38,7 +38,7 @@ count_iters=0
# valid_result: if value stored is '1' the result is valid, '0' otherwise # valid_result: if value stored is '1' the result is valid, '0' otherwise
valid_result=0 valid_result=0
parse_results() { function parse_results() {
local raw_results="${1}" local raw_results="${1}"
# Variables used for sum cummulative values in the case of two or more reps. # Variables used for sum cummulative values in the case of two or more reps.
@ -71,7 +71,7 @@ parse_results() {
info "Iteration# ${count_iters} memtotal: ${memtotal} memfree: ${memfree} memavailable: ${memavailable}" info "Iteration# ${count_iters} memtotal: ${memtotal} memfree: ${memfree} memavailable: ${memavailable}"
} }
store_results_json() { function store_results_json() {
metrics_json_start_array metrics_json_start_array
memtotalAvg=$(echo "scale=2; ${memtotalAvg} / ${count_iters}" | bc) memtotalAvg=$(echo "scale=2; ${memtotalAvg} / ${count_iters}" | bc)
memfreeAvg=$(echo "scale=2; ${memfreeAvg} / ${count_iters}" | bc) memfreeAvg=$(echo "scale=2; ${memfreeAvg} / ${count_iters}" | bc)