question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose an on_hatch event? And/or hatch number (e.g. we just hatched user number X) as well

See original GitHub issue

The API docs mention a hatch_complete event hook. That’s useful but I don’t always care to know about all users started (could monitor from other metrics in the test environment).

What could be useful to me is a way to track a hatch event, to do something on hatch.

On a related note, it would also be helpful to know what each hatched user’s number is (when they hatched as in I’m user number X). Helpful for data association to users based on ID/number. You don’t always want to do it randomly, sometimes yes.

So, could we get an on_hatch event hook?

What would be nice also would be if we could get whatever locust uses to track the current hatch count (or equivalent) available as an attribute to read from. Something like JMeter’s thread number/count property where in code you can figure out which user/thread number you are for whatever load logic you are trying to do. (e.g. self.locust.hatch_number)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
aldenpeterson-wfcommented, Nov 6, 2017

Hrm, I see what you are saying - you want effectively a “locust id” of sorts that you can use within the context of the on_start.

I wonder if something like that would be worth adding or finding a way to expose. I know at least one person who would find it beneficial (cc @thomaslevans-wf)

0reactions
heymancommented, Feb 24, 2020

On a related note, it would also be helpful to know what each hatched user’s number is (when they hatched as in I’m user number X).

This is unlikely to be built into Locust, because it would be hard to do when running Locust distributed. Slave nodes operate independently of each other, and when new nodes connect the master rebalances the simulated users across the nodes.

You can get the current number of users by calling runners.locust_runner.user_count

Please note that when running this in a slave node, this will only report the number of simulated users running in that node. Slave nodes do not know of the other running nodes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ocean acidification and global warming impair shark hunting ...
Newly hatched sharks were held under controlled laboratory conditions and fed ad libidum for 33–81days to determine the metabolic effects of ...
Read more >
The Effects of Salinity on Zootechnical Performance of Spotted ...
These results suggest that embryos and newly hatched larvae tolerate low salinity culture after hatch, and that grow out of juveniles at low...
Read more >
Marbled Murrelet - Oregon State University
Marbled Murrelets have been recorded in small numbers during the winter south to the dotted line. Individuals have also been recorded at inland...
Read more >
1+1 of Canada - BAC-LAC.gc.ca
gull predation on survival of common eider ducklings, between hatching and fledging ... The relatively large number of ducklings associated with Petit Manan....
Read more >
CN103396933A - Random array DNA analysis by hybridization ...
Through random array DNA analysis by hybridization, the invention relates to methods and devices for analyzing single molecules, i.e. nucleic acids.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found