Skip to content
Snippets Groups Projects
Commit 35d8da5c authored by Domenico Giordano's avatar Domenico Giordano
Browse files

adapt to new json structure

parent d899042a
No related branches found
No related tags found
No related merge requests found
......@@ -26,8 +26,9 @@ function parseResults(){
local resJSON=`grep "EVENT LOOP" proc_*/out_*.log | \
awk -F"|" 'BEGIN{amin=1000000;amax=0;count=0;} \
{ val=1000.*$5/$6; a[count]=val; count+=1; sum+=val; if(amax<val) amax=val; if(amin>val) amin=val} \
END{n = asort(a); if (n % 2) { median=a[(n + 1) / 2]; } else {median=(a[(n / 2)] + a[(n / 2) + 1])/ 2.0;}; printf "{\"score\": %.4f, \"avg\": %.4f, \"median\": %.4f, \"min\": %.4f, \"max\": %.4f}", sum, sum/count, median, amin, amax
}' || (echo "\"[ERROR] Something went wrong in parsing the Event Throughput score\""; exit 1)`
END{n = asort(a); if (n % 2) { median=a[(n + 1) / 2]; } else {median=(a[(n / 2)] + a[(n / 2) + 1])/ 2.0;};
printf "\"wl-scores\": {\"sim\": %.4f} , \"wl-stats\": {\"score\": %.4f, \"avg\": %.4f, \"median\": %.4f, \"min\": %.4f, \"max\": %.4f}", sum, sum, sum/count, median, amin, amax
}' || (echo "\"wl-scores\":{}"; exit 1)`
shstatus=$?
[ "$shstatus" != "0" ] && s_msg="ERROR in bash parsing"
echo $resJSON
......@@ -40,14 +41,14 @@ function parseResults(){
local app="\"UNKNOWN\""
if [ -f $BMKDIR/version.json ]; then app=$(cat $BMKDIR/version.json); fi
local OUTPUT=${APP}_summary_old.json
echo -e "{\"copies\":$NCOPIES , \"threads_per_copy\":1 , \"events_per_thread\" : $NEVENTS_THREAD , \"throughput_score\": $resJSON , \"log\": \"${s_msg}\", \"app\":${app} }" > $OUTPUT
echo -e "{\"copies\":$NCOPIES , \"threads_per_copy\":1 , \"events_per_thread\" : $NEVENTS_THREAD , $resJSON , \"log\": \"${s_msg}\", \"app\":${app} }" > $OUTPUT
cat $OUTPUT
#-----------------------
# Parse results (python)
#-----------------------
echo -e "\n[parseResults] python parser starting using $(python3 -V &> /dev/stdout)"
local resJSON2 # declare 'local' separately to avoid masking $? (https://stackoverflow.com/a/4421282)
resJSON2=$(PYTHONPATH=${parseResultsDir} python3 -c "from parseResults import *; parseBmkDir('.')") # same directory as parseResults.sh
resJSON2=$(PYTHONPATH=${parseResultsDir} python -c "from parseResults import *; parseBmkDir('.')") # same directory as parseResults.sh
pystatus=$?
[ "$pystatus" != "0" ] && s_msg="ERROR in python parsing"
echo $resJSON2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment