Add k6 activity ramp benchmark#236
Conversation
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR adds k6 benchmarking infrastructure in the benchmarks directory, not changes to API endpoints (packages/api/cmd/api/) or Temporal workflows (packages/api/lib/temporal). To monitor this PR anyway, reply with |
197e498 to
1c64321
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Ingress host port default mismatch between Makefile and TypeScript
- Updated the
loadConfig()fallback forHYPEMAN_INGRESS_HOST_PORTfrom 8081 to 80 so direct k6 runs match Makefile and README defaults.
- Updated the
- ✅ Fixed: Instance body tags use per-VU
config.runIdinstead of shareddata.runId- Changed instance creation tags to use
tags.run_idso created instances share the setup-provided run ID that teardown queries for cleanup.
- Changed instance creation tags to use
Or push these changes by commenting:
@cursor push a5823bc801
Preview (a5823bc801)
diff --git a/benchmarks/k6/activity-ramp.ts b/benchmarks/k6/activity-ramp.ts
--- a/benchmarks/k6/activity-ramp.ts
+++ b/benchmarks/k6/activity-ramp.ts
@@ -139,7 +139,7 @@
function loadConfig(): Config {
const baseUrl = trimRight(requiredEnv('HYPEMAN_BASE_URL', 'http://127.0.0.1:8080'), '/');
- const ingressHostPort = intEnv('HYPEMAN_INGRESS_HOST_PORT', 8081);
+ const ingressHostPort = intEnv('HYPEMAN_INGRESS_HOST_PORT', 80);
return {
baseUrl,
@@ -297,7 +297,7 @@
tags: {
benchmark: 'activity-ramp',
hypervisor: config.hypervisor || 'server-default',
- run_id: config.runId,
+ run_id: tags.run_id,
},
skip_kernel_headers: true,
};You can send follow-ups to the cloud agent here.
1c64321 to
8336845
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed:
requiredEnvis identical toenvString, adds no validationrequiredEnvnow fails when the resolved value is empty, so missing required variables with empty fallback are enforced instead of silently defaulting.
Or push these changes by commenting:
@cursor push cb21feedc7
Preview (cb21feedc7)
diff --git a/benchmarks/k6/activity-ramp.ts b/benchmarks/k6/activity-ramp.ts
--- a/benchmarks/k6/activity-ramp.ts
+++ b/benchmarks/k6/activity-ramp.ts
@@ -492,7 +492,11 @@
}
function requiredEnv(name: string, fallback: string): string {
- return envString(name, fallback);
+ const value = envString(name, fallback);
+ if (value === '') {
+ fail(`${name} is required`);
+ }
+ return value;
}
function intEnv(name: string, fallback: number): number {You can send follow-ups to the cloud agent here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Probe accepts client error responses
- Updated the ingress probe success condition to only treat 2xx/3xx responses as ready so 4xx client errors no longer count as successful probes.
Or push these changes by commenting:
@cursor push 7e39b6f3f9
Preview (7e39b6f3f9)
diff --git a/benchmarks/k6/activity-ramp.ts b/benchmarks/k6/activity-ramp.ts
--- a/benchmarks/k6/activity-ramp.ts
+++ b/benchmarks/k6/activity-ramp.ts
@@ -328,7 +328,7 @@
});
probeHTTPMs.add(res.timings.duration, tags);
- if (res.status >= 200 && res.status < 500) {
+ if (res.status >= 200 && res.status < 400) {
probeReadyMs.add(Date.now() - started, tags);
probeOk.add(true, tags);
return;You can send follow-ups to the cloud agent here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: VU step zero hangs load
- Added an early
cfg.vuStep < 1fail guard inrampStagesso invalid zero-step configs fail immediately instead of entering a non-advancing loop during options evaluation.
- Added an early
Or push these changes by commenting:
@cursor push aa58db4142
Preview (aa58db4142)
diff --git a/benchmarks/k6/activity-ramp.ts b/benchmarks/k6/activity-ramp.ts
--- a/benchmarks/k6/activity-ramp.ts
+++ b/benchmarks/k6/activity-ramp.ts
@@ -144,6 +144,9 @@
}
function rampStages(cfg: Config): Array<{ duration: string; target: number }> {
+ if (cfg.vuStep < 1) {
+ fail('HYPEMAN_BENCH_VU_STEP must be at least 1');
+ }
const stages: Array<{ duration: string; target: number }> = [];
for (let target = cfg.startVUs + cfg.vuStep; target <= cfg.maxVUs; target += cfg.vuStep) {
stages.push({ duration: cfg.stageDuration, target });You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 94b33cc. Configure here.
| if (cfg.vuStep < 1) { | ||
| fail('HYPEMAN_BENCH_VU_STEP must be at least 1'); | ||
| } | ||
| } |
There was a problem hiding this comment.
VU step zero hangs load
Medium Severity
export const options calls rampStages at module load, but checkRequiredConfig (which rejects HYPEMAN_BENCH_VU_STEP below 1) only runs in setup(). With HYPEMAN_BENCH_VU_STEP=0, the ramp loop never advances and the k6 process hangs before setup or any validation message.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 94b33cc. Configure here.



Summary
make -C benchmarks bench-activity-rampwith HTML and JSON report output under.bench/k6Validation
make -C benchmarks -n bench-activity-ramp HYPEMAN_API_KEY=dummydocker run --rm -v "$PWD":/src -w /src grafana/k6:latest inspect -e HYPEMAN_API_KEY=dummy benchmarks/k6/activity-ramp.tsgit diff --checkNote
Low Risk
Low risk: adds new benchmarking scripts/docs and ignores generated
.bench/output, with no changes to runtime server/CLI behavior.Overview
Adds a k6 TypeScript activity ramp benchmark that repeatedly creates an instance, waits for
Running, probes it via a shared pattern ingress, and deletes it, emitting stable per-operation metrics (including explicit tracking of capacity-rejected creates).Introduces
make -C benchmarks bench-activity-rampto run the benchmark and export HTML/JSON reports under.bench/k6, documents required environment variables and ingress/probe tuning, and updates.gitignoreto ignore.bench/outputs.Reviewed by Cursor Bugbot for commit 94b33cc. Bugbot is set up for automated code reviews on this repo. Configure here.