4562. [func] Add additional memory statistics currently malloced

and maxmalloced per memory context. [RT #43593]
This commit is contained in:
Mark Andrews
2017-02-02 15:36:38 +11:00
parent 4b0cd81a85
commit f783c2d579
8 changed files with 139 additions and 8 deletions

View File

@@ -172,6 +172,26 @@ if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
ret=0
echo "I:checking malloced memory statistics xml/json ($n)"
if [ $PERL_XML ]; then
file=`$PERL fetch.pl xml/v3/mem`
mv $file xml.mem
$PERL mem-xml.pl $file > xml.fmtmem
grep "'Malloced' => '[0-9][0-9]*'" xml.fmtmem > /dev/null || ret=1
grep "'malloced' => '[0-9][0-9]*'" xml.fmtmem > /dev/null || ret=1
grep "'maxmalloced' => '[0-9][0-9]*'" xml.fmtmem > /dev/null || ret=1
fi
if [ $PERL_JSON ]; then
file=`$PERL fetch.pl json/v1/mem`
mv $file json.mem
grep '"malloced":[0-9][0-9]*,' json.mem > /dev/null || ret=1
grep '"maxmalloced":[0-9][0-9]*,' json.mem > /dev/null || ret=1
grep '"Malloced":[0-9][0-9]*,' json.mem > /dev/null || ret=1
fi
if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
ret=0
echo "I:checking consistency between regular and compressed output ($n)"