forked from mtusi2026/mtusi2026lab5
feat: process attachments through durable versioned jobs
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import http from 'k6/http';
|
||||
import encoding from 'k6/encoding';
|
||||
import { check, sleep } from 'k6';
|
||||
export const options = { vus: 2, duration: '90s', thresholds: { checks: ['rate>0.95'] } };
|
||||
const base = __ENV.BASE_URL || 'https://hl.agapov.space';
|
||||
export function setup() {
|
||||
const username = `hpa_${Date.now()}`;
|
||||
const password = 'synthetic-autoscaling-password';
|
||||
const response = http.post(`${base}/api/v1/users`, JSON.stringify({ username, display_name: 'HPA CPU test', password }), { headers: { 'Content-Type': 'application/json' } });
|
||||
if (response.status !== 201) throw new Error(`registration: ${response.status}`);
|
||||
return { authorization: `Basic ${encoding.b64encode(`${username}:${password}`)}` };
|
||||
}
|
||||
export default function (data) {
|
||||
const response = http.post(`${base}/api/v1/auth/sessions`, null, { headers: { Authorization: data.authorization } });
|
||||
check(response, { 'authenticated login': r => r.status === 201 });
|
||||
// Keep one account below its 20 requests/s auth budget.
|
||||
sleep(0.1);
|
||||
}
|
||||
Reference in New Issue
Block a user