More performance tweaks
This commit is contained in:
parent
8c36083e16
commit
6a0628141a
9 changed files with 63 additions and 24 deletions
|
|
@ -201,6 +201,7 @@ new(){
|
|||
# - expected command return value (0 if OK)
|
||||
# - expected stdout outcome,
|
||||
# - expected2 stdout outcome,
|
||||
# Example: expectfn "$clixon_cli -1 -f $cfg show conf cli" 0 "^$"
|
||||
expectfn(){
|
||||
cmd=$1
|
||||
retval=$2
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi
|
||||
|
||||
# Number of list/leaf-list entries in file
|
||||
: ${perfnr:=2000}
|
||||
: ${perfnr:=10000}
|
||||
|
||||
# Number of requests made get/put
|
||||
: ${perfreq:=100}
|
||||
|
|
@ -50,9 +50,36 @@ cat <<EOF > $cfg
|
|||
<CLICON_RESTCONF_PRETTY>false</CLICON_RESTCONF_PRETTY>
|
||||
<CLICON_XMLDB_DIR>$dir</CLICON_XMLDB_DIR>
|
||||
<CLICON_XMLDB_PRETTY>false</CLICON_XMLDB_PRETTY>
|
||||
<CLICON_CLI_MODE>example</CLICON_CLI_MODE>
|
||||
<CLICON_CLI_DIR>/usr/local/lib/example/cli</CLICON_CLI_DIR>
|
||||
<CLICON_CLISPEC_DIR>/usr/local/lib/example/clispec</CLICON_CLISPEC_DIR>
|
||||
<CLICON_CLI_GENMODEL_COMPLETION>1</CLICON_CLI_GENMODEL_COMPLETION>
|
||||
<CLICON_CLI_GENMODEL_TYPE>VARS</CLICON_CLI_GENMODEL_TYPE>
|
||||
<CLICON_CLI_LINESCROLLING>0</CLICON_CLI_LINESCROLLING>
|
||||
</clixon-config>
|
||||
EOF
|
||||
|
||||
# Try startup mode w startup
|
||||
for mode in startup running; do
|
||||
file=$dir/${mode}_db
|
||||
sudo touch $file
|
||||
sudo chmod 666 $file
|
||||
new "generate large startup config ($file) with $perfnr list entries in mode $mode"
|
||||
echo -n "<config><x xmlns=\"urn:example:clixon\">" > $file
|
||||
for (( i=0; i<$perfnr; i++ )); do
|
||||
echo -n "<y><a>$i</a><b>$i</b></y>" >> $file
|
||||
done
|
||||
echo "</x></config>" >> $file
|
||||
|
||||
new "Startup backend once -s $mode -f $cfg -y $fyang"
|
||||
# Cannot use start_backend here due to expected error case
|
||||
time sudo $clixon_backend -F1 -D $DBG -s $mode -f $cfg -y $fyang # 2> /dev/null
|
||||
done
|
||||
|
||||
new "Startup backend once -s $mode -f $cfg -y $fyang"
|
||||
# Cannot use start_backend here due to expected error case
|
||||
time sudo $clixon_backend -F1 -D $DBG -s $mode -f $cfg -y $fyang # 2> /dev/null
|
||||
|
||||
new "test params: -f $cfg -y $fyang"
|
||||
if [ $BE -ne 0 ]; then
|
||||
new "kill old backend"
|
||||
|
|
@ -184,4 +211,5 @@ fi
|
|||
# kill backend
|
||||
stop_backend -f $cfg
|
||||
|
||||
|
||||
rm -rf $dir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue