For a project I had to write a simple script to generate mahimahi tracefiles for simple links (for example, bandwidth change every few seconds). The main issue was to adapt to every possible bandwidth :)
Here is a quick example for the code (Creating link varying between 16 Mbit/s and 32 Mbit/s every 5 seconds):
import random
def main():
length = 100
change = 5
trace = Trace([])
for x in range(int(length/change)):
trace += Trace.generate(random.random() * 16 + 16, change)
print("Generated bandwidth average", trace.get_avg_bw())
trace.to_file("custard_link.trace")
Hi everyone,
For a project I had to write a simple script to generate mahimahi tracefiles for simple links (for example, bandwidth change every few seconds). The main issue was to adapt to every possible bandwidth :)
Here is a quick example for the code (Creating link varying between 16 Mbit/s and 32 Mbit/s every 5 seconds):
You can take a look here: https://gist.github.com/shaymargolis/af946c8bb481b7a91a5863f286d77a5f
Hope this helps anyone!