locustfile.py 444 B

123456789101112131415
  1. from locust import HttpUser, between, task
  2. from events.test_data.event_generator import generate_random_event
  3. class WebsiteUser(HttpUser):
  4. wait_time = between(1.0, 2.0)
  5. @task
  6. def send_event(self):
  7. project_id = "1"
  8. dsn = "2ed2762c07a04261bec95b197f500626"
  9. event_url = f"/api/{project_id}/store/?sentry_key={dsn}"
  10. event = generate_random_event(True)
  11. self.client.post(event_url, json=event)