Hello Folks,
I am trying to identify an alternative to randomSwitch for distributing load amongst different chainbuilders based on percentage.
The problem that I see with randomSwitch is it doesn’t exactly follow the weights defined example 5 and 95 split. Sometimes i’ll get 3% and 97% others i’ll get 1% and 99% and so on… but doesn’t guarantee 5% and 95%.
I tried something like this (sudo code) but it didn’t even put the groups in report:
ScenarioBuilder fixedFlow = scenario ("Scenario for Fixed Flow")
.exec(mb.generateTraceId)
.group("Fixed").on(exec(session -> {
int nextCount = 0;
nextCount++;
if (nextCount % 100 < 2) {
group("Users with large fixed")
.on(feed(mfixedFeeder.circular()))
.exec(new LDSimulation().getMLDJourney());
} else {
group("Users with Less fixed")
.on(feed(ldFeeder.circular()))
.exec(new LDSimulation().getMLDJourney());
}
return session;
}))
When I write this, I see that it gets executed (may be as if I put print statements inside if else, they are getting printed and hence I am thinking execs are also getting executed) but it does not appear int he report.
Hence could someone please suggest an alternative to randomSwitch which guarantees weights or could someone help me correct my code so that the chainbuilders getting executed inside exec inside session gets included inthe report. Thanks for your help in advance.