Skip to content

Commit

Permalink
fix(storage-benchmark): Fix RAMGB calculation
Browse files Browse the repository at this point in the history
The previous calculation not always resulted in an integer, which wasn't what it was expected, and failed with some locales.

- Fixes: #80

- Based on input from #82 and #88.
  • Loading branch information
pablomh authored Mar 26, 2024
1 parent c056313 commit fdff1e6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions storage-benchmark
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ then
exit 1
fi

RAMGB=`grep MemTotal /proc/meminfo | awk '{s+=$2} END {print s / 1000000}'`
# Convert to integer
RAMGB=`printf "%.0f\n" "$RAMGB"`
RAMGB=$(awk '/^MemTotal:/ {printf "%d\n", $2 / 1024 / 1024}' /proc/meminfo)
FILEGB="$(($RAMGB * 2))"
TESTDIRECTORY=$TESTPATH/storage-benchmark

Expand Down

0 comments on commit fdff1e6

Please sign in to comment.