mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
17 lines
546 B
Bash
Executable File
17 lines
546 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# install brendangregg's FlameGraph
|
|
if [ ! -d "/usr/local/src/flamegraph" ]; then
|
|
mkdir /usr/local/src/flamegraph &&
|
|
cd /usr/local/src/flamegraph &&
|
|
git clone https://github.com/brendangregg/FlameGraph.git
|
|
fi
|
|
|
|
# let the test warm up
|
|
sleep 10
|
|
|
|
# run a 30 second profile on the Caddy admin port
|
|
cd /usr/local/src/flamegraph/FlameGraph &&
|
|
go tool pprof -raw -output=cpu.txt 'http://localhost:2019/debug/pprof/profile?seconds=30' &&
|
|
./stackcollapse-go.pl cpu.txt | ./flamegraph.pl >/go/src/app/testdata/performance/flamegraph.svg
|