You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am doing a new version of an existing system and I'd like to put it under the same "stress" level that the current one has.
I grabbed from the access logs a 10 minutes sample of the access and since both systems accept the exact parameters/url I was considering using locust to do it.
I have stats so, for example, Url A receives on average X requests/sec, Url B receives Y requests/sec.
The questions are :
is locust the tool to do it
based on the docs I could not figure it out how to do such a thing
The text was updated successfully, but these errors were encountered:
If you are trying to replay access logs to test your application, yes this is possible with locust and a wide range of other tools. However, I recommend using the same tool to test application of both versions so you're comparing apples to apples. With locust, you might try something like this:
importrefromlocustimportHttpLocust, TaskSet, task# Read your access log and extract the path from each line; use this list# of paths to request each urlpath_pattern=re.compile('REGEX_TO_MATCH_PATH')
withopen('access.log') asf:
lines=f.read().split('\n')
urls= []
forlineinlines:
urls.append(path_pattern.match(line).group(1))
classTasks(TaskSet):
@taskdefreplay(self):
self.client.get(urls.pop())
classLocust(HttpLocust):
min_wait=0max_wait=0task_set=UserTasks
I am doing a new version of an existing system and I'd like to put it under the same "stress" level that the current one has.
I grabbed from the access logs a 10 minutes sample of the access and since both systems accept the exact parameters/url I was considering using locust to do it.
I have stats so, for example, Url A receives on average X requests/sec, Url B receives Y requests/sec.
The questions are :
The text was updated successfully, but these errors were encountered: