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.

Core: add random generators to Gatling EL

See original GitHub issue

We could consider adding some random generator functions to Gatling Expression Language, such as:

  • random numbers (int, long), possibly with a range
  • random UUUI
  • random alphanum Strings with a length

Note: as this is a feature, it has to go in a minor version, which we release ~3 months. Implementation would be similar to what we do with currentTimeMillis. Performance is a must, so I recommend using ThreadLocalRandom.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
slandellecommented, Aug 12, 2022

I have to admit I would not be able to write generator as yours

You can check the RFC: https://www.rfc-editor.org/rfc/rfc4122.html

But honestly, I was in a hurry and adapted https://github.com/cowtowncoder/java-uuid-generator/blob/master/src/main/java/com/fasterxml/uuid/impl/UUIDUtil.java#L154-L160. All credits go to @cowtowncoder.

1reaction
slandellecommented, Aug 12, 2022

Is the next topic about random number?

Can we please go with topics one by one? First have a PR for UUID and merge it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Tutorial
First we import ThreadLocalRandom , to generate random values. We do a check on a condition that's been customized with a lambda. It...
Read more >
How to add random value in Json Body in Gatling?
First of all you want to generate random number each time, thus OrderRef has to be a method, like: def orderRef() = Random.nextInt(Integer....
Read more >
gatling-picatinny
This module contains vast number of random feeders. They could be used as regular feeders and realize common needs, i.e. random phone number...
Read more >
Performance testing with Gatling – advanced usage
Post summary: Code samples and explanation how to do advanced performance testing with Gatling, such as proper scenarios structure, checks, ...
Read more >
Generate pseudo-random numbers
The functions supplied by this module are actually bound methods of a hidden instance of the random.Random class. You can instantiate your own...
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