Skip to content

Commit

Permalink
embed async profiler to help user generate flame graph for frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed May 17, 2024
1 parent fff8344 commit 953a7c9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/profile_fe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ if [[ ! -x "${JAVA}" ]]; then
exit 1
fi

FE_PID=`jps | grep DorisFE | awk '{print $1}'`
FE_PID=$(jps | grep DorisFE | awk '{print $1}')
if [[ -z "$FE_PID" ]]; then
echo "DorisFe not started"
exit 1
echo "DorisFe not started"
exit 1
fi
echo "DorisFE pid: $FE_PID"

mkdir -p "${DORIS_HOME}/log"
NOW=`date +'%Y%m%d%H%M%S'`
NOW=$(date +'%Y%m%d%H%M%S')
PROFILE_OUTPUT="${DORIS_HOME}/log/profile_${NOW}.html"
if [[ -z "${PROFILE_SECONDS}" ]]; then
PROFILE_SECONDS="10"
fi

echo "Begin profiling ${PROFILE_SECONDS} seconds and generate flame graph to ${PROFILE_OUTPUT}..."
${JAVA} -jar "${DORIS_HOME}"/lib/ap-loader-all-*.jar profiler -a -n -l -i 200us -d "${PROFILE_SECONDS}" -f "${PROFILE_OUTPUT}" "${FE_PID}"
echo "Generated flame graph to ${PROFILE_OUTPUT}"
echo "Generated flame graph to ${PROFILE_OUTPUT}"

0 comments on commit 953a7c9

Please sign in to comment.