Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions pyperf/pyperf_run
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -190,26 +190,29 @@ generate_csv_file()
start_time=$2
end_time=$3

$TOOLS_BIN/test_header_info --front_matter --results_file "${1}.csv" --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version "py${PYTHON_VERSION}_$PYPERF_VERSION" --test_name $test_name_run --field_header "Test,Avg,Unit"
$TOOLS_BIN/test_header_info --front_matter --results_file "${1}.csv" --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version "py${PYTHON_VERSION}_$PYPERF_VERSION" --test_name $test_name_run --field_header "Test,Avg,Unit"


while IFS= read -r line
do
if [[ $test_name == "" ]]; then
test_name=$line
continue
fi
if [[ $line == *"Try to rerun "* ]]; then
continue
fi
if [ -z "$line" ]; then
let "reduce=$reduce+1"
if [[ $reduce -eq 2 ]]; then
if [[ $test_name != *"WARNING:"* ]]; then
results=`echo "${value_sum}/${res_count}" | bc -l`
printf "%s,%.2f,%s,%s,%s\n" $test_name $results $unit $start_time $end_time >> ${1}.csv
# Cannot use convert_val directly since it does not support floating point output
results=$(echo "${value_sum}/${res_count}" | bc -l | cut -d'.' -f1 )
sec_results=$(echo "$results/1000000000" | bc -l)
printf "%s,%f,sec,%s,%s\n" $test_name $sec_results $start_time $end_time >> ${1}.csv

if [[ $to_use_pcp -eq 1 ]]; then
metric_name="pyperf_${test_name}"
ns_results=$($TOOLS_BIN/convert_val --from_unit $unit --to_unit ns --time_val --value $results | sed -e 's/ns//g')
# Cannot use convert_val directly since it does not support floating point output
sec_results=$(echo "$ns_results/1000000000" | bc -l)
result2pcp "$metric_name" "${sec_results}"
fi
fi
Expand All @@ -225,19 +228,19 @@ generate_csv_file()
fi
value=`echo $line | cut -d' ' -f 4`
unit=`echo $line | cut -d' ' -f 5`
cnv_val=$($TOOLS_BIN/convert_val --time_val --from_unit $unit --to_unit ns --value $value | sed "s/ns//g")
let "res_count=${res_count}+1"
value_sum=`echo "${value}+${value_sum}" | bc -l`
value_sum=`echo "${cnv_val}+${value_sum}" | bc -l`
done < "${1}.results"

if [[ $test_name != *"WARNING:"* ]]; then
results=`echo "${value_sum}/${res_count}" | bc -l`
printf "%s,%.2f,%s,%s,%s\n" $test_name $results $unit $start_time $end_time >> ${1}.csv
results=$(echo "${value_sum}/${res_count}" | bc -l | cut -d'.' -f1 )
sec_results=$(echo "$results/1000000000" | bc -l)
printf "%s,%f,sec,%s,%s\n" $test_name $sec_results $start_time $end_time >> ${1}.csv

if [[ $to_use_pcp -eq 1 ]]; then
metric_name="pyperf_${test_name}"
ns_results=$($TOOLS_BIN/convert_val --from_unit $unit --to_unit ns --time_val --value $results | sed -e 's/ns//g')
# Cannot use convert_val directly since it does not support floating point output
sec_results=$(echo "$ns_results/1000000000" | bc -l)
sec_results=$(echo "$results/1000000000" | bc -l)
result2pcp "$metric_name" "${sec_results}"
fi
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
fi
Expand Down