shfmt -w globally
This commit is contained in:
parent
4e207414d4
commit
d5f66e4c0a
27 changed files with 378 additions and 375 deletions
|
@ -1,43 +1,43 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
function test_upload_profiles() {
|
||||
FORGEJO_URL="http://localhost:6060"
|
||||
PROFILECLI_URL="http://0.0.0.0:4040"
|
||||
FORGEJO_URL="http://localhost:6060"
|
||||
PROFILECLI_URL="http://0.0.0.0:4040"
|
||||
|
||||
endpoints=("/debug/pprof/allocs" "/debug/pprof/block" "/debug/pprof/goroutine" "/debug/pprof/mutex" "/debug/pprof/profile?seconds=5")
|
||||
curl -fL https://github.com/grafana/pyroscope/releases/download/v1.1.5/profilecli_1.1.5_linux_amd64.tar.gz -o profilecli.tar.gz
|
||||
tar xzf profilecli.tar.gz
|
||||
endpoints=("/debug/pprof/allocs" "/debug/pprof/block" "/debug/pprof/goroutine" "/debug/pprof/mutex" "/debug/pprof/profile?seconds=5")
|
||||
curl -fL https://github.com/grafana/pyroscope/releases/download/v1.1.5/profilecli_1.1.5_linux_amd64.tar.gz -o profilecli.tar.gz
|
||||
tar xzf profilecli.tar.gz
|
||||
|
||||
for endpoint in "${endpoints[@]}"; do
|
||||
output=$(basename "$endpoint")
|
||||
if [[ $endpoint == *"/profile"* ]]; then
|
||||
output="profile"
|
||||
fi
|
||||
output="${output}.pprof"
|
||||
# Download the content and save it to a file
|
||||
curl -s "${FORGEJO_URL}${endpoint}" -o "${output}"
|
||||
./profilecli upload ${output} --url=${PROFILECLI_URL}
|
||||
for endpoint in "${endpoints[@]}"; do
|
||||
output=$(basename "$endpoint")
|
||||
if [[ $endpoint == *"/profile"* ]]; then
|
||||
output="profile"
|
||||
fi
|
||||
output="${output}.pprof"
|
||||
# Download the content and save it to a file
|
||||
curl -s "${FORGEJO_URL}${endpoint}" -o "${output}"
|
||||
./profilecli upload ${output} --url=${PROFILECLI_URL}
|
||||
|
||||
rm ${output}
|
||||
done
|
||||
rm ${output}
|
||||
done
|
||||
}
|
||||
|
||||
function test_forgejo_pprof() {
|
||||
stop
|
||||
docker rm -f test_pyroscope
|
||||
docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope
|
||||
stop
|
||||
docker rm -f test_pyroscope
|
||||
docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope
|
||||
|
||||
reset_forgejo $UPGRADE_DIR/default-app.ini
|
||||
log_info "run 7.0-test"
|
||||
start 7.0-test
|
||||
test_upload_profiles
|
||||
stop
|
||||
reset_forgejo $UPGRADE_DIR/default-app.ini
|
||||
log_info "run 7.0-test"
|
||||
start 7.0-test
|
||||
test_upload_profiles
|
||||
stop
|
||||
|
||||
log_info "run 8.0-test"
|
||||
start 8.0-test
|
||||
test_upload_profiles
|
||||
stop
|
||||
|
||||
docker stop test_pyroscope
|
||||
log_info "run 8.0-test"
|
||||
start 8.0-test
|
||||
test_upload_profiles
|
||||
stop
|
||||
|
||||
docker stop test_pyroscope
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue