collect-results: collect "host_stats" files generated by collect-data template

collect-data template generates host_stats files which are collected.
All files are published, file names are determined by the contents:
    - Files that contain "top" output are named host_stats_<number>_top.txt
    - host_stats_<number>.txt otherwise

Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
sakib.sajal@windriver.com 2021-04-13 13:02:09 -04:00 committed by Richard Purdie
parent 93f939606a
commit 7593f93869

View File

@ -17,3 +17,22 @@ if [ -e $WORKDIR/buildhistory ]; then
$WORKDIR/../scripts/buildhistory-diff -p $WORKDIR/buildhistory ab-fetchrev > $DEST/$target/buildhistory.txt
fi
fi
HSFILE=$WORKDIR/tmp/buildstats/*/host_stats
d=`date +%Y-%m-%d--%H-%M`
mkdir -p $DEST/$target/$d
step=0
for f in $HSFILE; do
if [ -e $f ]; then
cp $f $DEST/$target/$d
grep -m 1 "^top -" $f
if [ $? -eq 0 ]; then
mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step}_top.txt
else
mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step}.txt
fi
step=$((step+1))
fi
done