ghz icon indicating copy to clipboard operation
ghz copied to clipboard

Ability to randomize requests made by ghz

Open aculver28 opened this issue 5 years ago • 3 comments

Describe the solution you'd like I have a service that takes in an array/repeated string field and I'd like to use ghz to simulate concurrent requests of varying sizes. For example, a request could look like this:

{
    "request_id":"abc",
    "request_type":"some type",
    "parameters":["val1", "val2"]
}

but it could also look like this:

{
    "request_id":"def",
    "request_type":"some type",
    "parameters":["val1", "val2","val3", "val4",...,"val5000"]
}

If at all possible, I'd like to be able to use the --data-file flag and have a JSON array (or newline delimited) of different requests and have ghz pick one at random for each request it makes. Ideally, an option to provide a custom metric to the report would be awesome, but I can see how that would get complicated and I could absolutely live without that in this otherwise amazing tool. 😄

Describe alternatives you've considered I've considered a script that picks a random request from a list of requests and executes a ghz test based on that, but the ultimate goal would be to see all the data in a single report.

aculver28 avatar Jun 16 '20 12:06 aculver28

+1

Who's to say my application or database is not caching data in some way, such that subsequent calls to an rpc with identical parameters yield results more quickly than they would for the traffic we are trying to simulate?

JacobCrofts avatar Jul 02 '20 20:07 JacobCrofts

What is way to make request with random data picked up from the input file?

shubham07507 avatar Jul 14 '21 12:07 shubham07507

What is way to make request with random data picked up from the input file?

Excuse me, have you resolved it?

appleezhang avatar May 08 '23 10:05 appleezhang