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

parameterize-able @Load methods #29

Open
eostermueller opened this issue Mar 14, 2020 · 0 comments
Open

parameterize-able @Load methods #29

eostermueller opened this issue Mar 14, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@eostermueller
Copy link
Owner

eostermueller commented Mar 14, 2020

load generators have a gazillion ways to pass data into the code that's being load tested.

Data from .csv files, random number generators, sequences of numbers, the list goes on.
But snail4j can't do this yet. See how I've added parameters to the method names in the below screenshots? That's my ugly shortcut for now.

For example, consider this text from the screenshot: "simulateSynchronizedSlowCode_sleepMilliseconds_1000". Not too tough to imagine that the source has a hard coded parameter of 1000.

Instead this hard coding, the dream is to pass parameters from the snail4j GUI directly into the method parameters of a method annotated with @com.github.eostermueller.snail4j.Load.

As an aside, the classes and method names in this screenshot got there because I added a special method-level annotation to the code I wanted to load. Snail4j uses ClassGraph to query for all classes with that annotation.

Then, snail4j instantiates the annotated class using (logically) prototype scope.
Plain reflection is used to invoke the method using this code, and the parameters from the Snail4j GUI would be specified there.

image

@eostermueller eostermueller added the enhancement New feature or request label Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant