Skip to content

Commit

Permalink
Update benchmarking (#2394)
Browse files Browse the repository at this point in the history
* update benchmarking

* default to localhost
  • Loading branch information
taylordowns2000 authored Aug 17, 2024
1 parent 8397e33 commit 0be4f3e
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions benchmarking/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down Expand Up @@ -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 });
}

0 comments on commit 0be4f3e

Please sign in to comment.