From 055648cbadeb1bbdaa44a2dc4a1d1e1d88d20ccc Mon Sep 17 00:00:00 2001 From: Jordi Arranz Date: Thu, 5 Jan 2023 15:28:46 +0000 Subject: [PATCH] Added handling of new simulation parameters: emitters_fraction and dist_type to the Starlark script --- src/wsl.star | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/wsl.star b/src/wsl.star index 36c234b..f4e1cc0 100644 --- a/src/wsl.star +++ b/src/wsl.star @@ -4,9 +4,9 @@ system_variables = import_module("github.com/logos-co/wakurtosis/src/system_vari # Module Imports files = import_module(system_variables.FILE_HELPERS_MODULE) -def create_wsl_config(simulation_time=300, message_rate=50, min_packet_size=1, max_packet_size=1024): +def create_wsl_config(simulation_time=300, message_rate=50, min_packet_size=1, max_packet_size=1024, dist_type='uniform', emitters_fraction=0.5): - template_data = {"simulation_time": simulation_time, "message_rate" : message_rate, "min_packet_size" : min_packet_size, "max_packet_size" : max_packet_size} + template_data = {"simulation_time": simulation_time, "message_rate" : message_rate, "min_packet_size" : min_packet_size, "max_packet_size" : max_packet_size, "dist_type" : dist_type, "emitters_fraction" : emitters_fraction} # Traffic simulation parameters wsl_yml_template = """ @@ -27,6 +27,14 @@ def create_wsl_config(simulation_time=300, message_rate=50, min_packet_size=1, m # Packet size in bytes min_packet_size : {{.min_packet_size}} max_packet_size : {{.max_packet_size}} + + # Packe size distribution + # Values: uniform and gaussian + dist_type : {{.dist_type}} + + # Fraction (of the total number of nodes) that inject traffic + # Values: [0., 1.] + emitters_fraction : {{.emitters_fraction}} """ artifact_id = render_templates(