Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
balancer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
4cf44483
authored
Mar 10, 2023
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
load testing auth
parent
eb6f5e2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
stresstest/main.py
+12
-7
No files found.
stresstest/main.py
View file @
4cf44483
import
json
from
locust
import
HttpUser
,
task
,
between
class
PerformanceTests
(
HttpUser
):
wait_time
=
between
(
1
,
3
)
from
locust
import
TaskSet
,
task
,
between
,
HttpUser
class
PerformanceTests
(
TaskSet
):
def
on_start
(
self
):
self
.
client
.
post
(
"/user/login"
,
{
resp
=
self
.
client
.
post
(
"/user/login"
,
json
=
{
"username"
:
"karsa"
,
"password"
:
"12345678"
})
self
.
client
.
headers
=
{
'Authorization'
:
'Bearer '
+
json
.
loads
(
resp
.
_content
)[
'access_token'
]}
@task
(
1
)
def
testFastApi
(
self
):
self
.
client
.
get
(
"/lb/dashboard/acpi/vm/1/"
)
\ No newline at end of file
self
.
client
.
get
(
"/lb/dashboard/acpi/vm/1/"
)
class
WebsiteUser
(
HttpUser
):
tasks
=
[
PerformanceTests
]
min_wait
=
5000
max_wait
=
9000
\ No newline at end of file
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