Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions benchmarks/current-regional/tsconfig.worker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"noEmit": true
},
"include": [
"./scenario.ts",
"./worker.ts"
]
}
40 changes: 20 additions & 20 deletions benchmarks/current-regional/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,26 +591,6 @@ function withColo(response: Response, request: Request): Response {
request as Request & {
cf?: { colo?: string };
}

function withStorageMetrics(
response: Response,
metrics: StoreCounters,
): Response {
const headers = new Headers(response.headers);
headers.set(
"x-benchmark-storage-reads",
String(metrics.reads),
);
headers.set(
"x-benchmark-storage-bytes",
String(metrics.readBytes),
);
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers,
});
}
).cf?.colo ?? "unknown";
const headers = new Headers(response.headers);
headers.set("x-benchmark-colo", colo);
Expand All @@ -621,6 +601,26 @@ function withColo(response: Response, request: Request): Response {
});
}

function withStorageMetrics(
response: Response,
metrics: StoreCounters,
): Response {
const headers = new Headers(response.headers);
headers.set(
"x-benchmark-storage-reads",
String(metrics.reads),
);
headers.set(
"x-benchmark-storage-bytes",
String(metrics.readBytes),
);
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers,
});
}

function json(value: unknown, status = 200): Response {
return Response.json(value, {
status,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"benchmark:s3": "tsx src/cli.ts --provider s3 --profile tiny",
"benchmark:compare:local": "tsx benchmarks/comparative/run.mjs",
"benchmark:current-regional:generate": "tsx benchmarks/current-regional/generate-data.mjs",
"benchmark:current-regional:build": "vite build --config benchmarks/current-regional/vite.config.ts",
"benchmark:current-regional:build": "tsc -p benchmarks/current-regional/tsconfig.worker.json --noEmit && vite build --config benchmarks/current-regional/vite.config.ts",
"benchmark:current-regional:aggregate": "tsx benchmarks/current-regional/aggregate.mjs",
"benchmark:current-regional:publish": "tsx benchmarks/current-regional/publish.mjs",
"benchmark:write-scaling": "tsx benchmarks/write-scaling/local.mjs",
Expand All @@ -136,7 +136,7 @@
"auth:roles:entra": "node scripts/generate-entra-roles.mjs",
"maintain:retention": "tsx src/retention-maintain.ts",
"fixtures:generate": "tsx scripts/generate-protocol-fixtures.ts",
"check": "tsc --noEmit && tsc -p studio/tsconfig.json",
"check": "tsc --noEmit && tsc -p studio/tsconfig.json && tsc -p benchmarks/current-regional/tsconfig.worker.json",
"test": "vitest run",
"test:e2e": "playwright test",
"verify:package": "node scripts/verify-package.mjs",
Expand Down
Loading