Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nodemanager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
nodemanager
Commits
371c785e
Commit
371c785e
authored
Mar 30, 2024
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update scripts log
parent
73f22492
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
script.js
docker/scripts/script.js
+15
-13
No files found.
docker/scripts/script.js
View file @
371c785e
...
@@ -2,12 +2,13 @@ import http from 'k6/http';
...
@@ -2,12 +2,13 @@ import http from 'k6/http';
import
{
check
,
fail
}
from
'
k6
'
;
import
{
check
,
fail
}
from
'
k6
'
;
export
const
options
=
{
export
const
options
=
{
vus
:
5
,
vus
:
1
,
duration
:
'
10s
'
,
duration
:
'
10s
'
,
};
};
export
default
function
()
{
export
default
function
()
{
const
url
=
'
http://43.198.252.255:8000/api/v1//txt2img/base/llm
'
;
// const url = 'http://43.198.252.255:8000/api/v1//txt2img/base/llm';
const
url
=
'
http://43.198.252.255:8000/api/v1//txt2img/base/llmm
'
;
const
payload
=
JSON
.
stringify
({
const
payload
=
JSON
.
stringify
({
"
test
"
:
1
"
test
"
:
1
})
})
...
@@ -18,16 +19,17 @@ export default function() {
...
@@ -18,16 +19,17 @@ export default function() {
},
},
};
};
var
res
=
http
.
post
(
url
,
payload
,
param
);
var
res
=
http
.
post
(
url
,
payload
,
param
);
const
checkOutput
=
check
(
const
statusCheck
=
check
(
res
,
{
res
,
'
status is 200
'
:
(
r
)
=>
r
.
status
===
200
,
{
});
'
response code was 200
'
:
(
res
)
=>
res
.
status
==
200
,
const
taskCheck
=
check
(
res
,
{
'
task is succeed
'
:
(
res
)
=>
res
.
json
(
"
task.is_success
"
)
==
true
,
'
task is success
'
:
(
r
)
=>
r
.
json
(
'
task.is_success
'
)
=
==
true
,
},
});
{
myTag
:
"
task success check
"
}
if
(
!
statusCheck
)
{
);
// console.log('task status failed', res.status
);
fail
(
'
task
'
+
res
.
headers
[
'
Task-Id
'
]
+
'
failed with status error:
'
+
res
.
status
);
if
(
!
checkOutput
)
{
}
else
if
(
!
taskCheck
)
{
fail
(
'
task failed with
error:
'
+
res
.
json
(
'
task.error
'
));
fail
(
'
task
'
+
res
.
headers
[
'
Task-Id
'
]
+
'
failed with execute
error:
'
+
res
.
json
(
'
task.error
'
));
}
}
// console.log("res is ", res);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment