Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the download links to the top and make sticky #129

Closed
ralfr opened this issue Feb 3, 2014 · 6 comments
Closed

Move the download links to the top and make sticky #129

ralfr opened this issue Feb 3, 2014 · 6 comments

Comments

@ralfr
Copy link

ralfr commented Feb 3, 2014

We've created a test that adds a random parameter to the GET URI to avoid caching. This correctly causes Locust to treat every single request as different (exactly what we intend to do).

Unfortunately, this makes the list of requests very very very loooooooong. In order to download the final test results, we'd have to scroll for hours.

Suggestion: Move the download links to the sticky nav bar at the top.

@sanga
Copy link
Contributor

sanga commented Feb 3, 2014

Making those links sticky would probably be nice, but you can solve your problem a different way. locust requests take can take a 'name' parameter with will bin all of those requests in a single bin with that name, irrespective of the url. In that way all of your GET requests will generate only 1 list entry

@heyman
Copy link
Member

heyman commented Feb 3, 2014

Yep, I recommend Tim's solution. Otherwise you will also run into memory problems after some time, since locust tracks a bunch of statistics for each URL entry.

Feeling a bit bad since I was the one who gave you the code snippet for adding that random URL parameter, and I completely forgot to add the name argument. Here's an updated version:

self.client.get("/some/path?rand=%i" % random.randint(0, 1000000), name="/some/path?rand=[random-number]")

@ralfr
Copy link
Author

ralfr commented Feb 4, 2014

No worries, glad there are folks here who are willing to help. One more thing: Is there any way to set a different host on a per task level?

I understand that via self.client.auth the authentication can be changed on a per task level and it works like a charm.

Unfortunately, self.client.host does not work an giving self.client.get() an absolute URI, including protocol and host doesn't either.

Any idea?

@heyman
Copy link
Member

heyman commented Feb 4, 2014

I you give a full URL (including hostname) to client.get(), the request will be made to that host. However, this won't be visible in the statistics unless you use the name argument to make it so.

Like this:

self.client.get("http://other.host.com/some/path", name="http://other.host.com/some/path")

@ralfr
Copy link
Author

ralfr commented Feb 4, 2014

I think all of this would be worth to be added to the docs at locust.io :-)

@heyman
Copy link
Member

heyman commented Feb 4, 2014

I agree :). I've added a section about grouping requests using the name argument now: http://docs.locust.io/en/latest/writing-a-locustfile.html#grouping-requests-to-urls-with-dynamic-parameters

@heyman heyman closed this as completed Feb 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants