From ef8bd44e98d76b8c39564e2e64fc95301c3121fa Mon Sep 17 00:00:00 2001 From: pfg Date: Sat, 15 Feb 2025 22:46:18 -0800 Subject: [PATCH] Track performance stats (#17246) Co-authored-by: Jarred Sumner --- .buildkite/ci.mjs | 17 +++++++++++++++++ .buildkite/scripts/upload-benchmark.ts | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 .buildkite/scripts/upload-benchmark.ts diff --git a/.buildkite/ci.mjs b/.buildkite/ci.mjs index 7b07dafb47..9969aacb79 100755 --- a/.buildkite/ci.mjs +++ b/.buildkite/ci.mjs @@ -621,6 +621,21 @@ function getReleaseStep(buildPlatforms, options) { }; } +/** + * @returns {Step} + */ +function getBenchmarkStep() { + return { + key: "benchmark", + label: "📊", + agents: { + queue: "build-zig", + }, + command: "bun .buildkite/scripts/upload-benchmark.ts", + depends_on: [`linux-x64-build-bun`], + }; +} + /** * @typedef {Object} Pipeline * @property {Step[]} [steps] @@ -1099,6 +1114,8 @@ async function getPipeline(options = {}) { steps.push(getReleaseStep(buildPlatforms, options)); } + steps.push(getBenchmarkStep()); + /** @type {Map} */ const stepsByGroup = new Map(); diff --git a/.buildkite/scripts/upload-benchmark.ts b/.buildkite/scripts/upload-benchmark.ts new file mode 100644 index 0000000000..eb98acd464 --- /dev/null +++ b/.buildkite/scripts/upload-benchmark.ts @@ -0,0 +1,7 @@ +import { getCommit, getSecret } from "../../scripts/utils.mjs"; + +console.log("Submitting..."); +const response = await fetch(getSecret("BENCHMARK_URL") + "?tag=_&commit=" + getCommit() + "&artifact_url=_", { + method: "POST", +}); +console.log("Got status " + response.status);