I’ve analyzed the traffic to my service, and I find that the mix of transactions varies as a function of volume. As overall traffic increases, some flows take up an increasingly larger and larger percentage of the traffic. Others remain flat no matter how much traffic there is overall.
What I’d LIKE to do, if it is technically feasible, is to model the traffic where the percentage of the time when a certain flow is triggered is a function of the total traffic volume. Then as the target volume goes up, instead of taking on a fixed percentage of the traffic, it dynamically adjusts to more closely match what we really see. Basically, I’m thinking a dynamic randomSwitch.
Now, as I recall, randomSwitch can only take constants, not functions, so I can’t model it that way.
What I assume I can do is write a function that calculates the percentages for each flow as a function of total volume and randomly chooses which flow to use, then use a regular switch
to actually trigger the flows.
So my question to you is: in my function, how do I know what the target user injection rate is at that moment? For instance, rampUsersPerSec( 5 ) to (100 ) over (2.hours) - half way through the simulation, the users per second rate should be a little over 50. Is there a way I can ask Gatling what the current injection rate is in users per second?
If not, can you think of another way of accomplishing what I’m trying to do?