-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlocustfile.py
42 lines (39 loc) · 1.83 KB
/
locustfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from locust import HttpUser, task
import json
class QuickstartUser(HttpUser):
@task
def create_post(self):
headers = {'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Accept-Encoding': 'gzip, defalte', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0',}
self.client.post("seedwords2",
data={
'algorithm': 'Algorithm: Linear projection',
'concept1_name': 'Gender',
'concept2_name': 'Concept2',
'equalize': 'man-woman,he-him,she-her',
'evalwords': 'engineer, lawyer, receptionist, homemaker',
'orth_subspace': 'scientist, doctor, nurse, secretary, maid, dancer, cleaner, advocate, player, banker',
'seedwords1': 'he',
'seedwords2': 'she',
'subspace_method': 'Subspace method: Two means'},
headers=headers)
#
# class WebsiteUser(HttpUser):
# task_set = UserBehavior
# #
#
# class QuickstartUser(HttpUser):
# wait_time = between(1, 2.5)
#
# @task
# def make_request(self):
# self.client.post("seedwords2", body={
# 'algorithm': 'Algorithm: Linear projection',
# 'concept1_name': 'Gender',
# 'concept2_name': 'Concept2',
# 'equalize': 'man-woman,he-him,she-her',
# 'evalwords': 'engineer, lawyer, receptionist, homemaker',
# 'orth_subspace': 'scientist, doctor, nurse, secretary, maid, dancer, cleaner, advocate, player, banker',
# 'seedwords1': 'he',
# 'seedwords2': 'she',
# 'subspace_method': 'Subspace method: Two means'
# })