Guest User

Untitled

a guest
Mar 31st, 2017
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. from cassandra.cluster import Cluster
  2.  
  3. from locust import Locust, events, task, TaskSet
  4.  
  5. class CassandraClient(object):
  6.  
  7. def __init__(self, host):
  8. cluster = Cluster([host])
  9. self.session = cluster.connect("demo")
  10.  
  11. class CassandraLocust(Locust):
  12.  
  13. def __init__(self, *args, **kwargs):
  14. super(CassandraLocust, self).__init__(*args, **kwargs)
  15. self.client = CassandraClient(self.host)
  16.  
  17. def random_select(self):
  18. pass
  19.  
  20.  
  21. class ApiUser(CassandraLocust):
  22.  
  23. host = "127.0.0.1"
  24.  
  25. class task_set(TaskSet):
  26.  
  27. @task(1)
  28. def read_random(self):
  29. pass
Advertisement
Add Comment
Please, Sign In to add comment