A library that implements dynamic tracing for express.
It also includes platform specific scripts to output traces for visualization.
fedora
$ sudo dnf install elfutils-libelf-devel
ubuntu
sudo apt install libelf1 libelf-dev
all
$ git clone https://github.com/sthima/libstapsdt.git
$ cd libstapsdt
$ make
$ sudo make install
curl http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/12.0-RELEASE/src.txz > src.txz
tar -C / -xvf src.txz
% npm install express -S
% npm install https://github.com/No9/express-tracer.git -S
% npm install dtrace-express -S
There are two ways to instrument your express application. The first is to raise single events and allow them to be interpreted by the analysis tool. The second is to perform latency analysis at runtime.
% node examples/events/server.js
In a seperate console as root run
# bpftrace -p $(pgrep node) examples/events/event.bt
In another seperate console Genrate some load with artillery
% npm install artillery -g
% artillery quick --duration 60 --rate 10 -n 20 http://localhost:3000/event
Now stop the dtrace sample and do some post processing.