mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 03:44:14 +08:00
mdbx-test: add --db-upto-mb
option for stochastic script.
This commit is contained in:
parent
584326e9b6
commit
de4a6baf80
@ -12,6 +12,7 @@ LOOPS=
|
|||||||
SKIP_MAKE=no
|
SKIP_MAKE=no
|
||||||
BANNER="$(which banner 2>/dev/null | echo echo)"
|
BANNER="$(which banner 2>/dev/null | echo echo)"
|
||||||
UNAME="$(uname -s 2>/dev/null || echo Unknown)"
|
UNAME="$(uname -s 2>/dev/null || echo Unknown)"
|
||||||
|
DB_UPTO_MB=17408
|
||||||
|
|
||||||
while [ -n "$1" ]
|
while [ -n "$1" ]
|
||||||
do
|
do
|
||||||
@ -25,6 +26,7 @@ do
|
|||||||
echo "--upto NN"
|
echo "--upto NN"
|
||||||
echo "--loops NN"
|
echo "--loops NN"
|
||||||
echo "--dir PATH"
|
echo "--dir PATH"
|
||||||
|
echo "--db-upto-mb NN"
|
||||||
;;
|
;;
|
||||||
--multi)
|
--multi)
|
||||||
LIST=basic
|
LIST=basic
|
||||||
@ -76,6 +78,14 @@ do
|
|||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--db-upto-mb)
|
||||||
|
DB_UPTO_MB="$2"
|
||||||
|
if [ -z "$DB_UPTO_MB" -o "$DB_UPTO_MB" -lt 1 -o "$DB_UPTO_MB" -gt 4194304 ]; then
|
||||||
|
echo "Invalid value '$DB_UPTO_MB' for --db-upto-mb option"
|
||||||
|
exit -2
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown option '$1'"
|
echo "Unknown option '$1'"
|
||||||
exit -2
|
exit -2
|
||||||
@ -189,8 +199,8 @@ fi
|
|||||||
# system immediately, as well some space is required for logs.
|
# system immediately, as well some space is required for logs.
|
||||||
#
|
#
|
||||||
db_size_mb=$(((ram_avail_mb - ram_reserve4logs_mb) / 4))
|
db_size_mb=$(((ram_avail_mb - ram_reserve4logs_mb) / 4))
|
||||||
if [ $db_size_mb -gt 17408 ]; then
|
if [ $db_size_mb -gt $DB_UPTO_MB ]; then
|
||||||
db_size_mb=17408
|
db_size_mb=$DB_UPTO_MB
|
||||||
fi
|
fi
|
||||||
echo "=== use ${db_size_mb}M for DB"
|
echo "=== use ${db_size_mb}M for DB"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user