Cirrus: Make benchmarks .env file easier to load

The `benchmarks.env` file is intended for machine consumption.
Including things like a `kB` unit label (like `$MEMTOTAL`) make items
difficult to parse.  Additionally, multi-value keys (like `$UNAME_RM`)
make extra/unnecessary work for the interpreter.  Simplify these items
and include a data-schema version marker so an interpreter can be made
aware/support future format changes.

Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
Chris Evich
2023-02-09 15:39:15 -05:00
parent a7db3e8d2c
commit 45fb353f46

View File

@ -346,10 +346,12 @@ localbenchmarks() {
# Checked above in req_env_vars
# shellcheck disable=SC2154
echo "\
BENCH_ENV_VER=1
CPUTOTAL=$(grep -ce '^processor' /proc/cpuinfo)
INST_TYPE=$EC2_INST_TYPE # one day may include other cloud's VM types.
MEMTOTAL=$(awk -F: '$1 == "MemTotal" { print $2 }' </proc/meminfo | sed -e "s/^ *//")
UNAME_RM=$(uname -r -m)
INST_TYPE=$EC2_INST_TYPE
MEMTOTALKB=$(awk -F: '$1 == "MemTotal" { print $2 }' </proc/meminfo | sed -e "s/^ *//" | cut -d ' ' -f 1)
UNAME_R=$(uname -r)
UNAME_M=$(uname -m)
"
) > $datadir/benchmarks.env
make localbenchmarks | tee $datadir/benchmarks.raw