Problem: the total duration of an experiment is equal to last traffic generator plus the experiment duration which is inaccurate
TEACUP calculates the total_duration as max(TrafficGen_wait_time[i])+ V_duration for i = 1 to number of traffic generators
Example:
V_duration= 60
( '0.0', '1', " start_iperf, client='192.168.1.161', server='192.168.1.151', port=5000, duration=V_duration" ),
( '50.0', '2', " start_iperf, client='192.168.1.161', server='192.168.1.151', port=5000, duration=20 " ),
TEACUP waits for 120s (50+60+10)).
Note: 10 is additional wait time added by teacup.
Fix: The correct total_duration calculation (in my opinion) should be max(V_duration, TrafficGen_wait_time[i] +TrafficGen_duration[i]) for i = 1 to number of traffic generators
For the above example, the correct waiting time should be 80s (50+20+10)
The patch has been attached.
I appreciate that somebody finally cleans this up :). But shouldn't the duration simply be max(TrafficGen_wait_time[i] +TrafficGen_duration[i]) for i = 1 to number of traffic generators? Otherwise, we would still potentially have extra wait time, e..g if somebody defines duration but then does use a shorter constant duration for the first and only defined traffic generator.
That's true. However, I included the experiment duration in the calculation of the total duration just in case the user intentionally wants to run the experiment for extra time (e.g. to launch external traffic generators for testing purposes). If you see that this is not th case, I can remove the duration from total duration calculation.
Ok. Sounds like a good idea. The code also looks good to me. Have you updated the documentation? I assign this to Grenville as you guys are closer to each other :).
Applied in https://sourceforge.net/p/teacup/code/ci/75624d28a630951ef24056da0f07a64bf05455d1/