summaryrefslogtreecommitdiffhomepage
path: root/.buildkite
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2021-01-06 15:36:23 -0800
committergVisor bot <gvisor-bot@google.com>2021-01-06 15:44:07 -0800
commitfa8682da0fd43556ae0a405c02bac27e6d15a8e6 (patch)
tree7ff8382863d3f8b753589d93d119ce36efd20ac4 /.buildkite
parentf89af8b5045bfdcb24ce8cc74ed676d77c9e67a6 (diff)
Export a pprof visualization endpoint.
This allows us to link directly to profiling results from the build results. The code uses the standard pprof http server, exported from the Cloud Run instance. PiperOrigin-RevId: 350440910
Diffstat (limited to '.buildkite')
-rw-r--r--.buildkite/hooks/post-command8
1 files changed, 6 insertions, 2 deletions
diff --git a/.buildkite/hooks/post-command b/.buildkite/hooks/post-command
index 5cd974002..8af1369a6 100644
--- a/.buildkite/hooks/post-command
+++ b/.buildkite/hooks/post-command
@@ -27,10 +27,14 @@ make -s testlogs 2>/dev/null | grep // | sort | uniq | (
# Upload all profiles, and include in an annotation.
declare profile_output=$(mktemp --tmpdir)
for file in $(find /tmp/profile -name \*.pprof -print 2>/dev/null | sort); do
- # Generate a link to the profile file at the top.
+ # Generate a link to the profile parsing function in gvisor.dev, which
+ # implicitly uses a prefix of https://storage.googleapis.com. Note that
+ # this relies on the specific BuildKite bucket location, and will break if
+ # this changes (although the artifacts will still exist and be just fine).
profile_name="${file#/tmp/profile/}"
+ profile_url="https://gvisor.dev/profile/gvisor-buildkite/${BUILDKITE_BUILD_ID}/${BUILDKITE_JOB_ID}/${file#/}/"
buildkite-agent artifact upload "${file}"
- echo "<li><a href='artifact://${file#/}'>${profile_name}</a></li>" >> "${profile_output}"
+ echo "<li><a href='${profile_url}'>${profile_name}</a></li>" >> "${profile_output}"
done
# Upload if we had outputs.