Skip to content

Commit

Permalink
scripts: use pprofme for pprof-post
Browse files Browse the repository at this point in the history
They've changed their endpoints and the script no longer works. But they
now have a `cli`. Make the script a wrapper around the cli so that
anyone who uses pprof-post will find out it exists.

Epic: none
Release note: None
  • Loading branch information
tbg committed Mar 16, 2023
1 parent 4dc10b5 commit e829627
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scripts/pprof-post.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail

# Usage: $0 "optional description, defaults to current date" < somefile.pb.gz
out=$(curl -s 'https://api.polarsignals.com/api/share/v1/profiles' \
-X POST \
-F "description=${1-$(date -u)}" \
-F "profile=@-")
echo -n "https://share.polarsignals.com/"
grep -Eo '[0-9a-f]{4,}' <<< "${out}"

if ! which pprofme; then
echo "pprofme missing, setup instructions: https://github.com/polarsignals/pprofme#install"
exit 1
fi

pprofme upload "$@"

0 comments on commit e829627

Please sign in to comment.