forked from TabbyML/tabby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import http from 'k6/http'; | ||
import { check, group, sleep } from 'k6'; | ||
|
||
export const options = { | ||
stages: [ | ||
{ duration: '5s', target: 10 }, // simulate ramp-up of traffic from 1 to 10 users over 30s. | ||
{ duration: '30s', target: 10 }, // stay at 10 users for 10 minutes | ||
{ duration: '5s', target: 0 }, // ramp-down to 0 users | ||
], | ||
thresholds: { | ||
'http_req_duration': ['p(99)<1000'], // 99% of requests must complete below 1000ms | ||
}, | ||
}; | ||
|
||
export default () => { | ||
const payload = JSON.stringify({ | ||
prompt: "def binarySearch(arr, left, right, x):\n mid = (left +", | ||
}); | ||
const headers = { "Content-Type": "application/json" }; | ||
const res = http.post("http://localhost:5000/v1/completions", payload, { | ||
headers, | ||
}); | ||
check(res, { success: (r) => r.status === 200 }); | ||
sleep(0.5); | ||
}; |