Skip to content

Commit 3d8b19a

Browse files
committed
smol docs
1 parent 4e9f9cb commit 3d8b19a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/k6_load_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import { sleep, check } from 'k6'
1111
const staging = 'http://gptwrapper.toska.svc.cluster.local:8000/api/ai/stream'
1212
const local = 'http://172.17.0.1:3000/api//ai/stream'
1313

14+
// k6 will pickup the options object internally.
1415
const vusit = 50
15-
1616
export const options = {
1717
vus: vusit,
1818
iterations: vusit,
1919
}
2020

21-
const headerParams = {
21+
const headers = {
2222
headers: {
2323
'Content-Type': 'application/json',
2424
uid: 'testUser',
@@ -29,8 +29,6 @@ const headerParams = {
2929
},
3030
}
3131

32-
const messages = ['listaa viisi esinettä', 'kerro niistä jotain', 'anna esimerkki jokaisesta esineestä', 'kerro yksityiskohtaisemmin', 'tiivistä kertomasi']
33-
3432
const data = {
3533
options: {
3634
messages: [],
@@ -44,6 +42,8 @@ const data = {
4442
courseId: 'sandbox',
4543
}
4644

45+
const messages = ['listaa viisi esinettä', 'kerro niistä jotain', 'anna esimerkki jokaisesta esineestä', 'kerro yksityiskohtaisemmin', 'tiivistä kertomasi']
46+
4747
function handleTokens(tokenizedStr) {
4848
let texts = []
4949
let responseId = ''
@@ -83,7 +83,7 @@ export default function () {
8383
data: JSON.stringify(newData),
8484
})
8585

86-
let res = http.post(url, payload, headerParams)
86+
let res = http.post(url, payload, headers)
8787
const { response, responseId } = handleTokens(res.body)
8888
prevResponseId = responseId
8989

0 commit comments

Comments
 (0)