Skip to content

Instantly share code, notes, and snippets.

@shubhamvashisht
Last active October 22, 2020 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shubhamvashisht/d0a28eef1d712b63b3ea74df9d33a8ed to your computer and use it in GitHub Desktop.
Save shubhamvashisht/d0a28eef1d712b63b3ea74df9d33a8ed to your computer and use it in GitHub Desktop.
from locust import HttpUser, task, between
#globals
hostBaseUrl = "http://13.229.188.140/v2"
showDetailsEndpoint = '/content_api/show.get_details?show_id=286f0228a0151d620929e504844bf3483f442793&curr_ptr=0&info_level=max&override_end_index=false&caller_uid=f0b58f5f38ecf6c665201d828bb576592f791d78&add_combo=false&is_unlocked=true&from_queue=false&last_seq_num=0'
feedDetailsEndpoint = '/feed_api/get_similar_items?entity_id=d4201143a0aeed484b71cee2707f6ebb4ca41188&entity_type=story&recommendation_type=discovery'
class RandomUser(HttpUser):
wait_time = between(0.03,0.05)
host = hostBaseUrl
@task
def randomisedShowRequestTask(self):
response = self.client.get(showDetailsEndpoint)
print('request type = {} and response code = {}\n'.format('show',response.status_code))
@task
def randomisedFeedRequestTask(self):
response = self.client.get(feedDetailsEndpoint)
print('request type = {} and response code = {}\n'.format('feed',response.status_code))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment