mirror of https://gitee.com/bigwinds/arangodb
clean up perf script
This commit is contained in:
parent
1a55b449e4
commit
9157debf96
|
@ -6,54 +6,60 @@
|
||||||
#
|
#
|
||||||
# This script sets up performance monitoring events to measure single
|
# This script sets up performance monitoring events to measure single
|
||||||
# document operations. Run this script with sudo when the ArangoDB
|
# document operations. Run this script with sudo when the ArangoDB
|
||||||
# process is already running. Then do
|
# process is already running:
|
||||||
|
#
|
||||||
|
# ./setupPerfEvents.sh
|
||||||
|
#
|
||||||
|
# Now you are able to recrod the event with:
|
||||||
|
#
|
||||||
# sudo perf record -e "probe_arangod:*" -aR sleep 60
|
# sudo perf record -e "probe_arangod:*" -aR sleep 60
|
||||||
# (to sample for 60 seconds). A file "perf.data" is written to the
|
#
|
||||||
# current directory.
|
# The above command will get sample data for 60 seconds. A file "perf.data" is
|
||||||
# Dump the events in this file with
|
# written to the current directory. Dump the events in this file with:
|
||||||
|
#
|
||||||
# sudo perf script > perf.history
|
# sudo perf script > perf.history
|
||||||
|
#
|
||||||
# This logs the times when individual threads hit the events.
|
# This logs the times when individual threads hit the events.
|
||||||
# Use the program perfanalyis.cpp in this directory in the following way:
|
# Use the program perfanalyis.cpp in this directory in the following way:
|
||||||
|
#
|
||||||
# sudo ./perfanalyis < perf.history > perf.statistics
|
# sudo ./perfanalyis < perf.history > perf.statistics
|
||||||
# This will group enter and exit events of functions together, compute
|
#
|
||||||
# the time spent and sort by function.
|
# This will group enter and exit events of functions together, compute the time
|
||||||
# Remove all events with
|
# spent and sort by function. When finised remove all events with:
|
||||||
|
#
|
||||||
# sudo perf probe -d "probe_arangod:*"
|
# sudo perf probe -d "probe_arangod:*"
|
||||||
# List events with
|
#
|
||||||
|
# List events with:
|
||||||
|
#
|
||||||
# sudo perf probe -l
|
# sudo perf probe -l
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
ARANGOD_EXECUTABLE=build/bin/arangod
|
main(){
|
||||||
perf probe -x $ARANGOD_EXECUTABLE -d "probe_arangod:*"
|
local ARANGOD_EXECUTABLE=build/bin/arangod
|
||||||
|
|
||||||
echo Adding events, this takes a few seconds...
|
#delete all existing events
|
||||||
|
perf probe -x $ARANGOD_EXECUTABLE -d "probe_arangod:*" || exit 1
|
||||||
|
|
||||||
addEvent() {
|
echo "Adding events, this takes a few seconds..."
|
||||||
x=$1
|
|
||||||
y=$2
|
echo "Single document operations..."
|
||||||
if [ "x$y" == "x" ] ; then
|
|
||||||
y=$x
|
|
||||||
fi
|
|
||||||
echo $x
|
|
||||||
perf probe -x $ARANGOD_EXECUTABLE -a $x=$y 2> /dev/null
|
|
||||||
perf probe -x $ARANGOD_EXECUTABLE -a ${x}Ret=$y%return 2> /dev/null
|
|
||||||
}
|
|
||||||
echo Single document operations...
|
|
||||||
addEvent insertLocal
|
addEvent insertLocal
|
||||||
addEvent removeLocal
|
addEvent removeLocal
|
||||||
addEvent modifyLocal
|
addEvent modifyLocal
|
||||||
addEvent documentLocal
|
addEvent documentLocal
|
||||||
|
|
||||||
echo Single document operations on coordinator...
|
echo "Single document operations on coordinator..."
|
||||||
addEvent insertCoordinator
|
addEvent insertCoordinator
|
||||||
addEvent removeCoordinator
|
addEvent removeCoordinator
|
||||||
addEvent updateCoordinator
|
addEvent updateCoordinator
|
||||||
addEvent replaceCoordinator
|
addEvent replaceCoordinator
|
||||||
addEvent documentCoordinator
|
addEvent documentCoordinator
|
||||||
|
|
||||||
echo work method in HttpServerJob
|
echo "work method in HttpServerJob"
|
||||||
addEvent workHttpServerJob work@HttpServerJob.cpp
|
addEvent workHttpServerJob work@HttpServerJob.cpp
|
||||||
|
|
||||||
echo work method in RestDocumentHandler
|
echo "work method in RestDocumentHandler"
|
||||||
addEvent executeRestReadDocument readDocument@RestDocumentHandler.cpp
|
addEvent executeRestReadDocument readDocument@RestDocumentHandler.cpp
|
||||||
addEvent executeRestInsertDocument createDocument@RestDocumentHandler.cpp
|
addEvent executeRestInsertDocument createDocument@RestDocumentHandler.cpp
|
||||||
addEvent handleRequest handleRequest@HttpServer.cpp
|
addEvent handleRequest handleRequest@HttpServer.cpp
|
||||||
|
@ -63,3 +69,15 @@ addEvent tcp_sendmsg
|
||||||
addEvent tcp_recvmsg
|
addEvent tcp_recvmsg
|
||||||
|
|
||||||
echo Done.
|
echo Done.
|
||||||
|
}
|
||||||
|
|
||||||
|
addEvent() {
|
||||||
|
local name="$1"
|
||||||
|
local func="${2-"${name}"}"
|
||||||
|
|
||||||
|
echo "setting up $name for function: $func"
|
||||||
|
perf probe -x $ARANGOD_EXECUTABLE -a $name=$func 2> /dev/null #enter function
|
||||||
|
perf probe -x $ARANGOD_EXECUTABLE -a ${name}Ret=$func%return 2> /dev/null #return form function
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
|
Loading…
Reference in New Issue