yocto-autobuilder-helper/scripts/collect-results
sakib.sajal@windriver.com 7593f93869 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>
2021-04-15 14:54:02 +01:00

39 lines
969 B
Bash
Executable File

#!/bin/bash
WORKDIR=$1
DEST=$2
target=$3
RESFILE=$WORKDIR/tmp/log/oeqa/testresults.json
if [ -e $RESFILE ]; then
mkdir -p $DEST/$target
cp $WORKDIR/tmp/log/oeqa/testresults.json $DEST/$target/
fi
if [ -e $WORKDIR/buildhistory ]; then
# ab-fetchrev tag set in buildhistory-init
if [ $(git -C $WORKDIR/buildhistory tag -l "ab-fetchrev") ]; then
mkdir -p $DEST/$target
$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