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

Unique task id available ? #349

Closed
sprenge opened this issue Oct 20, 2015 · 5 comments
Closed

Unique task id available ? #349

sprenge opened this issue Oct 20, 2015 · 5 comments

Comments

@sprenge
Copy link

sprenge commented Oct 20, 2015

I am looking for a way to assign to each task instance a unique number (starting from zero for instance), this should be cluster unique (no overlapping numbers between slaves).
For the test case I am running it is required to have unique credentials for each task instance. Is this possible with locustio ?

@andrej-talon
Copy link

I would be interested in an answer as well. I saw that the Runner class has a number that could be used, but haven't been able to access it.

Currently, I solved it by using itertools.counter and advance it each time a request is made. However, it would be nice to expose the "real" number somehow.

@sprenge
Copy link
Author

sprenge commented Apr 14, 2016

I assume that the trick with itertools.counter only works within a single process ? I solved it implementing a global webservice (using Flask), returning a unique counter id

@brentsmyth
Copy link

Anyone have any more luck here in terms of a distributed setup?

@worldmind
Copy link

I am not sure, but may it helps - I found this question on SO, it shows how make unique user, for unique task id you can use something like it with PostgreSQL sequence for getting IDs.

@cyberw
Copy link
Collaborator

cyberw commented Oct 31, 2019

Closed due to inactivity.

@cyberw cyberw closed this as completed Oct 31, 2019
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

6 participants