Merge pull request #6673 from ipfs/collect-profiles-on-mac

fix: make collect-profiles.sh work on mac
This commit is contained in:
Steven Allen 2019-09-24 07:47:59 -07:00 committed by GitHub
commit e921121bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

8
bin/collect-profiles.sh Normal file → Executable file
View File

@ -3,7 +3,7 @@ set -x
set -euo pipefail
IFS=$'\n\t'
HTTP_API="${1:-localhost:5001}"
HTTP_API="${1:-127.0.0.1:5001}"
tmpdir=$(mktemp -d)
export PPROF_TMPDIR="$tmpdir"
pushd "$tmpdir"
@ -36,9 +36,5 @@ echo "Disabling mutex profiling"
curl -X POST -v "http://$HTTP_API"'/debug/pprof-mutex/?fraction=0'
popd
tar cvzf "./ipfs-profile-$(uname -n)-$(date -Iseconds).tar.gz" -C "$tmpdir" .
tar cvzf "./ipfs-profile-$(uname -n)-$(date +'%Y-%m-%dT%H:%M:%S%z').tar.gz" -C "$tmpdir" .
rm -rf "$tmpdir"