rich-policeman-92383
06/27/2022, 8:32 PMrich-policeman-92383
06/28/2022, 11:53 AMrich-policeman-92383
07/01/2022, 12:02 PMimport json
from locust import HttpUser, between, task, events
url = "https://<yourdomain>/api/graphql"
payload = json.dumps({
"query": "{\n me {\n corpUser {\n username\n }\n }\n}",
"variables": {}
})
headers = {
'Authorization': 'Bearer <Your token>',
'Content-Type': 'application/json'
}
class BrowseUser(HttpUser):
wait_time = between(1, 5)
def on_start(self):
<http://self.client.post|self.client.post>(url, headers=headers, data=payload)
@task
def browse(self):
<http://self.client.post|self.client.post>(
"/entities?action=browse",
json.dumps(
{
"path": "/perf/test",
"entity": "dataset",
"start": 0,
"limit": 10,
}
),
headers=headers,
)