Skip to content

Commit 97a5b45

Browse files
authored
Merge pull request #8 from redhat-performance/add_run_info
Add run output and results summary
2 parents bc095f5 + 1592b29 commit 97a5b45

File tree

1 file changed

+17
-58
lines changed

1 file changed

+17
-58
lines changed

pyperf/pyperf_run

Lines changed: 17 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ install_tools()
5555
fi
5656
}
5757

58-
5958
generate_csv_file()
6059
{
6160
re='^[0-9]+$'
@@ -97,63 +96,6 @@ generate_csv_file()
9796
printf "%s %12.2f\n" $test_name $results >> ${1}.csv
9897
}
9998

100-
generate_csv_file pyperf_out_2022.05.12-10.06.09
101-
generate_csv_file()
102-
{
103-
re='^[0-9]+$'
104-
instance=0
105-
float=0
106-
ivalue=0
107-
fvalue=0.0
108-
test_name=""
109-
unit=""
110-
while IFS= read -r line
111-
do
112-
if [[ $line == *"--"* ]]; then
113-
if [ $instance -ne 0 ]; then
114-
if [ $float -eq 1 ]; then
115-
value=`echo "scaling=2;${fvalue}/${instance}" | bc -l`
116-
printf "%s:%10.2f:%s\n" $test_name $value $unit | sed "s/ //g" >> ${1}.csv
117-
else
118-
value=`echo "${ivalue}/${instance}" | bc`
119-
echo ${test_name}:${value}:${unit} >> ${1}.csv
120-
fi
121-
fi
122-
ivalue=0
123-
fvalue=0
124-
test_name=$prior
125-
instance=0
126-
float=0
127-
fi
128-
prior=$line
129-
if [[ $line == *"calibrate"* ]]; then
130-
continue
131-
fi
132-
if [[ $line == *"warmup"* ]]; then
133-
continue
134-
fi
135-
value=`echo $line | cut -d' ' -f4 | sed "s/\.//g"`
136-
if ! [[ $value =~ $re ]] ; then
137-
continue
138-
fi
139-
let "instance=${instance}+1"
140-
value=`echo $line | cut -d' ' -f4`
141-
unit=`echo $line | cut -d' ' -f5`
142-
if [[ $value == *"."* ]]; then
143-
float=1
144-
fvalue=`echo "${fvalue}+${value}"| bc -l`
145-
else
146-
float=0
147-
ivalue=`echo "${ivalue}+${value}"| bc`
148-
fi
149-
done < "${1}.results"
150-
#
151-
# Do not forget the last one.
152-
#
153-
value=`echo "${ivalue}/${instance}" | bc`
154-
echo ${test_name}:${value}:${unit} >> ${1}.csv
155-
}
156-
15799
#
158100
# Variables set by general setup.
159101
#
@@ -190,6 +132,16 @@ else
190132
run_dir=`echo $0 | cut -d'/' -f 1-${chars}`
191133
fi
192134

135+
if [ ! -f "/tmp/pyperf.out" ]; then
136+
command="${0} $@"
137+
echo $command
138+
$command &> /tmp/pyperf.out
139+
cat /tmp/pyperf.out
140+
rm /tmp/pyperf.out
141+
exit
142+
fi
143+
144+
193145
if [ -d "workloads" ]; then
194146
#
195147
# If running from zathras, workloads will be symlinked to
@@ -287,6 +239,13 @@ else
287239
rm results_${test_name_run}_${to_tuned_setting}
288240
ln -s ${RESULTSDIR} results_${test_name_run}_${to_tuned_setting}
289241
mv ${test_name_run}_*.out ${RESULTSDIR}
242+
lines=`wc -l ${RESULTSDIR}/*.csv | cut -d' ' -f1`
243+
if [ $? -ne 0 ]; then
244+
echo Failed >> test_results_report
245+
else
246+
echo Ran >> test_results_report
247+
fi
248+
cp /tmp/hammerdb.out ${RESULTSDIR}
290249
cp ${curdir}/meta_data.yml ${RESULTSDIR}
291250
tar hcf results_${test_name_run}_${to_tuned_setting}.tar results_${test_name_run}_${to_tuned_setting}
292251
cp results_${test_name_run}_${to_tuned_setting}.tar results_pbench_${test_name_run}_${to_tuned_setting}.tar

0 commit comments

Comments
 (0)