mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-07 12:29:56 +00:00
Merge pull request #7387 from GabyCT/topic/fixmemoryinsidec
metrics: Add function to memory inside container script
This commit is contained in:
commit
fe07ac662d
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user