Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alliballibaba2 committed Dec 22, 2024
1 parent bf48b14 commit 4f0cc8a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion testdata/performance/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const options = {
thresholds: {
http_req_failed: ['rate<0.01']
}
};
}

/* global __ENV */
export default function () {
Expand Down
2 changes: 1 addition & 1 deletion testdata/performance/computation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const options = {
thresholds: {
http_req_failed: ['rate<0.01']
}
};
}

/* global __ENV */
export default function () {
Expand Down
2 changes: 1 addition & 1 deletion testdata/performance/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const options = {
thresholds: {
http_req_failed: ['rate<0.01']
}
};
}

/* global __ENV */
export default function () {
Expand Down
8 changes: 4 additions & 4 deletions testdata/performance/flamegraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

# install brendangregg's FlameGraph
if [ ! -d "/usr/local/src/flamegraph" ]; then
mkdir /usr/local/src/flamegraph && \
cd /usr/local/src/flamegraph && \
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' && \
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
2 changes: 1 addition & 1 deletion testdata/performance/perf-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ select filename in ./testdata/performance/*.js; do
read -r -p "How many worker threads? " workerThreads
read -r -p "How many max threads? " maxThreads

numThreads=$((workerThreads+1))
numThreads=$((workerThreads + 1))

docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
-p 8125:80 \
Expand Down
6 changes: 3 additions & 3 deletions testdata/performance/start-server.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# build and run FrankenPHP with the k6.Caddyfile
cd /go/src/app/caddy/frankenphp && \
go build --buildvcs=false && \
cd ../../testdata/performance && \
cd /go/src/app/caddy/frankenphp &&
go build --buildvcs=false &&
cd ../../testdata/performance &&
/go/src/app/caddy/frankenphp/frankenphp run -c k6.Caddyfile

0 comments on commit 4f0cc8a

Please sign in to comment.