Skip to content

Commit 1ba99e9

Browse files
committed
ft-orchestration pass requried variables for batch-means method in ft-analyzer
1 parent 8e5581f commit 1ba99e9

4 files changed

Lines changed: 42 additions & 8 deletions

File tree

tools/ft-orchestration/src/config/scenario.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ class SimConfig(YAMLWizard):
109109
pps: Optional[int] = None
110110
mbps: Optional[int] = None
111111
speed_multiplier: Optional[float] = None
112+
start_phase_duration: Optional[int] = 10
113+
end_phase_duration: Optional[int] = 10
112114
probe: Optional[ProbeCfg] = None
113115
generator: Optional[FtGeneratorConfig] = None
114116
prefilter_ranges: Optional[list[str]] = None

tools/ft-orchestration/tests/simulation/test_simulation_general.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ def validate(
6363
biflows: bool,
6464
log_dir: os.PathLike,
6565
host_stats_file: os.PathLike,
66+
loops: int,
67+
start_phase_duration: int,
68+
end_phase_duration: int,
69+
speed_multiplier: float,
6670
) -> tuple[StatisticalReport, Optional[PreciseReport]]:
6771
"""Perform statistical and/or precise model evaluation of the test scenario.
6872
@@ -92,15 +96,19 @@ def validate(
9296

9397
if analysis.model == "precise":
9498
model = PreciseModel(
95-
flows_file,
96-
ref_file,
9799
active_timeout,
98-
inactive_timeout,
99-
stats,
100-
log_dir,
100+
flows=flows_file,
101+
reference=ref_file,
102+
inactive_timeout=inactive_timeout,
103+
stats=stats,
104+
log_dir=log_dir,
101105
biflows_ts_correction=biflows,
102106
use_statistical_counter=analysis.use_statistic_counter,
103107
host_stats=host_stats_file,
108+
loops=loops,
109+
start_phase_duration=start_phase_duration,
110+
end_phase_duration=end_phase_duration,
111+
speed_multiplier=speed_multiplier,
104112
)
105113
if len(prefilter_conf) > 0:
106114
precise_report = model.validate_precise(
@@ -128,6 +136,10 @@ def validate(
128136
use_statistical_counter=analysis.use_statistic_counter,
129137
host_stats=host_stats_file,
130138
inactive_timeout=inactive_timeout,
139+
loops=loops,
140+
start_phase_duration=start_phase_duration,
141+
end_phase_duration=end_phase_duration,
142+
speed_multiplier=speed_multiplier,
131143
)
132144
precise_report = None
133145
metrics = analysis.metrics
@@ -375,7 +387,7 @@ def finalizer_download_logs():
375387

376388
flows_file_future.result()
377389
flows_file = StatisticalModel.prepare_flows_file(flows_file, stats)
378-
replicated_ref = replicated_ref_future.result()
390+
replicated_ref, speed_multiplier = replicated_ref_future.result()
379391

380392
stats_report, precise_report = validate(
381393
analysis=scenario.test.analysis,
@@ -388,6 +400,10 @@ def finalizer_download_logs():
388400
log_dir=log_dir,
389401
host_stats_file=probe_instance.host_statistics.local_file,
390402
inactive_timeout=inactive_t,
403+
loops=scenario.test.loops,
404+
start_phase_duration=scenario.default.start_phase_duration,
405+
end_phase_duration=scenario.default.end_phase_duration,
406+
speed_multiplier=speed_multiplier,
391407
)
392408

393409
print("")

tools/ft-orchestration/tests/simulation/test_simulation_overload.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def finalizer_download_logs():
323323

324324
flows_file_future.result()
325325
flows_file = StatisticalModel.prepare_flows_file(flows_file, stats)
326-
replicated_ref = replicated_ref_future.result()
326+
replicated_ref, speed_multiplier = replicated_ref_future.result()
327327

328328
model = StatisticalModel(
329329
flows_file,
@@ -333,6 +333,10 @@ def finalizer_download_logs():
333333
use_statistical_counter=scenario.test.analysis.use_statistic_counter,
334334
host_stats=probe_instance.host_statistics.local_file,
335335
inactive_timeout=inactive_t,
336+
loops=scenario.test.loops,
337+
start_phase_duration=scenario.default.start_phase_duration,
338+
end_phase_duration=scenario.default.end_phase_duration,
339+
speed_multiplier=speed_multiplier,
336340
)
337341
report = model.validate(
338342
[SMRule(scenario.test.analysis.metrics, segment) for segment in segments]

tools/ft-orchestration/tests/simulation/test_simulation_threshold.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ def validate(
5353
log_dir: os.PathLike,
5454
host_stats_file: os.PathLike,
5555
inactive_timeout: int,
56+
loops: int,
57+
start_phase_duration: int,
58+
end_phase_duration: int,
59+
speed_mutliplier: float,
5660
) -> tuple[bool, StatisticalReport]:
5761
"""Perform statistical and/or precise model evaluation of the test scenario.
5862
@@ -82,6 +86,10 @@ def validate(
8286
use_statistical_counter=analysis.use_statistic_counter,
8387
host_stats=host_stats_file,
8488
inactive_timeout=inactive_timeout,
89+
loops=loops,
90+
start_phase_duration=start_phase_duration,
91+
end_phase_duration=end_phase_duration,
92+
speed_multiplier=speed_mutliplier,
8593
)
8694
stats_report = model.validate([SMRule(analysis.metrics)])
8795
print("")
@@ -275,7 +283,7 @@ def run_single_test(
275283

276284
flows_file_future.result()
277285
flows_file = StatisticalModel.prepare_flows_file(flows_file, stats)
278-
replicated_ref = replicated_ref_future.result()
286+
replicated_ref, speed_multiplier = replicated_ref_future.result()
279287

280288
flow_replicator = None
281289
gc.collect()
@@ -288,6 +296,10 @@ def run_single_test(
288296
log_dir=current_log_dir,
289297
host_stats_file=probe_instance.host_statistics.local_file,
290298
inactive_timeout=inactive_t,
299+
loops=scenario.test.loops,
300+
start_phase_duration=scenario.default.start_phase_duration,
301+
end_phase_duration=scenario.default.end_phase_duration,
302+
speed_mutliplier=speed_multiplier,
291303
)
292304

293305
return ret, report

0 commit comments

Comments
 (0)