Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update csv report format for service log #136

Merged
merged 2 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion hack/test-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ CLIENTIMAGE_AUTO_DELETE=${CLIENTIMAGE_AUTO_DELETE:-true}
SIMIMAGE_AUTO_DELETE=${SIMIMAGE_AUTO_DELETE:-true}

#log collection parameter
DIR_ROOT=${DIR_ROOT:-"~"}
DIR_ROOT=${DIR_ROOT:-"$HOME"}
SIM_LOG_DIR=${SIM_LOG_DIR:-"${DIR_ROOT}/logs"}
SERVER_LOG_DIR=${SERVER_LOG_DIR:-"${DIR_ROOT}/logs"}
CLIENT_LOG_DIR=${CLIENT_LOG_DIR:-"${DIR_ROOT}/logs"}
DES_LOG_DIR=${DES_LOG_DIR:-"${DIR_ROOT}/grs/logs/${SERVER_NUM}se${SIM_NUM}si${CLIENT_NUM}cl"}
DES_LOG_INSTANCE=${DES_LOG_INSTANCE:-"sonyadev4"}
DES_LOG_INSTANCE_ZONE=${DES_LOG_INSTANCE_ZONE:-"us-central1-a"}
LOCAL_LOG_ONLY=${LOCAL_LOG_ONLY:-false}


#rune2e parameter
Expand Down
76 changes: 49 additions & 27 deletions hack/test-loganalysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,35 +105,57 @@ echo "" >> ./csv/${csv_name}


echo "Collecting service test summary to csv"

for name in $( ls | grep server);do

grep "\[Metrics\]\[AGG_RECEIVED\]" ${name} >> ./csv/${csv_name}
echo "${name}">> ./csv/${csv_name}
echo "Metrics Item","perc50","perc90","perc99","Total count">> ./csv/${csv_name}
metrics_item="[Metrics][AGG_RECEIVED]"
grep_line=$(grep "\[Metrics\]\[AGG_RECEIVED\]" $name | tail -1)
perc50=$(echo $grep_line | sed "s/.*perc50 //; s/, perc90.*//")
perc90=$(echo $grep_line | sed "s/.*perc90 //; s/, perc99.*//")
perc99=$(echo $grep_line | sed "s/.*perc99 //; s/\. Total.*//")
total_count=$(echo $grep_line | sed "s/.*Total count //")
echo "${metrics_item}","${perc50}","${perc90}","${perc99}","${total_count}">> ./csv/${csv_name}

###adding empty line to csv
echo "" >> ./csv/${csv_name}
echo "" >> ./csv/${csv_name}
grep "\[Metrics\]\[DIS_RECEIVED\]" ${name} >> ./csv/${csv_name}
metrics_item="[Metrics][DIS_RECEIVED]"
grep_line=$(grep "\[Metrics\]\[DIS_RECEIVED\]" $name | tail -1)
perc50=$(echo $grep_line | sed "s/.*perc50 //; s/, perc90.*//")
perc90=$(echo $grep_line | sed "s/.*perc90 //; s/, perc99.*//")
perc99=$(echo $grep_line | sed "s/.*perc99 //; s/\. Total.*//")
total_count=$(echo $grep_line | sed "s/.*Total count //")
echo "${metrics_item}","${perc50}","${perc90}","${perc99}","${total_count}">> ./csv/${csv_name}

###adding empty line to csv
echo "" >> ./csv/${csv_name}
echo "" >> ./csv/${csv_name}
grep "\[Metrics\]\[DIS_SENDING\]" ${name} >> ./csv/${csv_name}

###adding empty line to csv
echo "" >> ./csv/${csv_name}
echo "" >> ./csv/${csv_name}
grep "\[Metrics\]\[DIS_SENT\]" ${name} >> ./csv/${csv_name}

###adding empty line to csv
echo "" >> ./csv/${csv_name}
echo "" >> ./csv/${csv_name}
grep "\[Metrics\]\[SER_ENCODED\]" ${name} >> ./csv/${csv_name}

###adding empty line to csv
echo "" >> ./csv/${csv_name}
echo "" >> ./csv/${csv_name}
grep "\[Metrics\]\[SER_SENT\]" ${name} >> ./csv/${csv_name}
metrics_item="[Metrics][DIS_SENDING]"
grep_line=$(grep "\[Metrics\]\[DIS_SENDING\]" $name | tail -1)
perc50=$(echo $grep_line | sed "s/.*perc50 //; s/, perc90.*//")
perc90=$(echo $grep_line | sed "s/.*perc90 //; s/, perc99.*//")
perc99=$(echo $grep_line | sed "s/.*perc99 //; s/\. Total.*//")
total_count=$(echo $grep_line | sed "s/.*Total count //")
echo "${metrics_item}","${perc50}","${perc90}","${perc99}","${total_count}">> ./csv/${csv_name}

metrics_item="[Metrics][DIS_SENT]"
grep_line=$(grep "\[Metrics\]\[DIS_SENT\]" $name | tail -1)
perc50=$(echo $grep_line | sed "s/.*perc50 //; s/, perc90.*//")
perc90=$(echo $grep_line | sed "s/.*perc90 //; s/, perc99.*//")
perc99=$(echo $grep_line | sed "s/.*perc99 //; s/\. Total.*//")
total_count=$(echo $grep_line | sed "s/.*Total count //")
echo "${metrics_item}","${perc50}","${perc90}","${perc99}","${total_count}">> ./csv/${csv_name}

metrics_item="[Metrics][SER_ENCODED]"
grep_line=$(grep "\[Metrics\]\[SER_ENCODED\]" $name | tail -1)
perc50=$(echo $grep_line | sed "s/.*perc50 //; s/, perc90.*//")
perc90=$(echo $grep_line | sed "s/.*perc90 //; s/, perc99.*//")
perc99=$(echo $grep_line | sed "s/.*perc99 //; s/\. Total.*//")
total_count=$(echo $grep_line | sed "s/.*Total count //")
echo "${metrics_item}","${perc50}","${perc90}","${perc99}","${total_count}">> ./csv/${csv_name}

metrics_item="[Metrics][SER_SENT]"
grep_line=$(grep "\[Metrics\]\[SER_SENT\]" $name | tail -1)
perc50=$(echo $grep_line | sed "s/.*perc50 //; s/, perc90.*//")
perc90=$(echo $grep_line | sed "s/.*perc90 //; s/, perc99.*//")
perc99=$(echo $grep_line | sed "s/.*perc99 //; s/\. Total.*//")
total_count=$(echo $grep_line | sed "s/.*Total count //")
echo "${metrics_item}","${perc50}","${perc90}","${perc99}","${total_count}">> ./csv/${csv_name}

done

echo "Please check generated csv report under ./csv/${csv_name}"
echo "Please check generated csv report under ${DESTINATION}/csv/${csv_name}"
13 changes: 9 additions & 4 deletions hack/test-logcollect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,15 @@ if [ ${SIM_NUM} -gt 0 ]; then
fi

"${GRS_ROOT}/hack/test-loganalysis.sh"
echo "Copying logs to destination instance."
copy-logs "${DES_LOG_INSTANCE}" "${DES_LOG_INSTANCE_ZONE}" "${DESTINATION}" "${DES_LOG_DIR}"
echo "Removing local copy from ${DESTINATION}"
sudo rm -r "${DESTINATION}"
if [ "${LOCAL_LOG_ONLY}" == "true" ]; then
echo "All logs copied to local dev machine:${DESTINATION}"
else
echo "Copying logs to destination instance."
copy-logs "${DES_LOG_INSTANCE}" "${DES_LOG_INSTANCE_ZONE}" "${DESTINATION}" "${DES_LOG_DIR}"
echo "All logs copied to ${DES_LOG_INSTANCE}:${DESTINATION}"
echo "Removing local copy from ${DESTINATION}"
sudo rm -r "${DESTINATION}"
fi