From 0be4f3e245990356ce5e0c9589541990e07e09c4 Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Sat, 17 Aug 2024 08:17:24 +0100 Subject: [PATCH] Update benchmarking (#2394) * update benchmarking * default to localhost --- benchmarking/script.js | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/benchmarking/script.js b/benchmarking/script.js index 29945ab125..3bc0c3255d 100644 --- a/benchmarking/script.js +++ b/benchmarking/script.js @@ -8,17 +8,31 @@ const webhookURL = export const options = { discardResponseBodies: true, scenarios: { - webhookRequests: { - executor: 'ramping-arrival-rate', - startRate: 1, + // test: { + // executor: 'constant-arrival-rate', + // rate: 1, + // timeUnit: '1s', + // duration: '1s', + // preAllocatedVUs: 100, + // }, + open_model: { + executor: 'constant-arrival-rate', + rate: 50, timeUnit: '1s', - preAllocatedVUs: 50, - stages: [ - { duration: '30s', target: 50 }, // go from 1 to 50 rps in the first 30 seconds - { duration: '1m30s', target: 50 }, // hold at 50 rps for 1.5 minutes - { duration: '20s', target: 0 }, // ramp down back to 0 rps over the last 30 seconds - ], + duration: '5m', + preAllocatedVUs: 100, }, + // webhookRequests: { + // executor: 'ramping-arrival-rate', + // startRate: 1, + // timeUnit: '1s', + // preAllocatedVUs: 500, + // stages: [ + // { duration: '30s', target: 50 }, // go from 1 to 50 rps in the first 30 seconds + // { duration: '1m30s', target: 50 }, // hold at 50 rps for 1.5 minutes + // { duration: '20s', target: 0 }, // ramp down back to 0 rps over the last 30 seconds + // ], + // }, }, thresholds: { http_req_failed: ['rate<0.0001'], // http errors should be less than 0.01% @@ -49,5 +63,13 @@ export default function (data) { const payload = JSON.stringify(data.payload); const headers = { 'Content-Type': 'application/json' }; const res = http.post(webhookURL, payload, { headers }); + if (res.status != 200) + console.log( + res.status, + res.status_text, + res.body, + res.error, + res.error_code + ); check(res, { 'status was 200': r => r.status == 200 }); }