Skip to content

Commit 610c4bf

Browse files
committed
ft-orchestration introduce cache_size param for all used probes
1 parent 2d6282a commit 610c4bf

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

tools/ft-orchestration/src/probe/cento.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def __init__(
112112
verbose: bool = False,
113113
mtu: int = 2048,
114114
sudo: bool = False,
115+
cache_size=None,
115116
**kwargs: dict,
116117
):
117118
interfaces_names = [ifc.name for ifc in interfaces]

tools/ft-orchestration/src/probe/interface.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def __init__(
8888
mtu,
8989
active_timeout,
9090
inactive_timeout,
91+
cache_size,
9192
**kwargs,
9293
):
9394
"""Initialize the local or remote probe interface as object

tools/ft-orchestration/src/probe/nprobe.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,16 @@ def __init__(
121121
verbose: bool = False,
122122
mtu: int = 2048,
123123
sudo: bool = False,
124+
cache_size=None,
124125
**kwargs: dict,
125126
):
126127
interfaces_names = [ifc.name for ifc in interfaces]
127128
self._interfaces = interfaces_names
128129
self._zero_copy = any(ifc.startswith("zc:") for ifc in self._interfaces)
129130
settings: NProbeSettings = NProbeSettings(
130-
interface=interfaces_names[0], **kwargs
131+
interface=interfaces_names[0],
132+
max_num_flows=2**cache_size if cache_size else None,
133+
**kwargs,
131134
)
132135
self._executor = executor
133136

tools/ft-orchestration/src/probe/yaf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def __init__(
183183
mtu: int = 2048,
184184
sudo: bool = False,
185185
inactive_timeout: int = 50,
186+
cache_size=None,
186187
**kwargs: dict,
187188
):
188189
if len(interfaces) > 1:
@@ -206,7 +207,11 @@ def __init__(
206207
kwargs["pcap"] = YafSettings.PCAPOptions(**(kwargs.get("pcap", {})))
207208
kwargs["tls"] = YafSettings.TLSOptions(**(kwargs.get("tls", {})))
208209
kwargs["log"] = YafSettings.LoggingOptions(**(kwargs.get("log", {})))
209-
self._settings = YafSettings(idle_timeout=inactive_timeout, **kwargs)
210+
self._settings = YafSettings(
211+
idle_timeout=inactive_timeout,
212+
maxflows=2**cache_size if cache_size else None,
213+
**kwargs,
214+
)
210215
self._executor = executor
211216
if isinstance(executor, RemoteExecutor):
212217
connection: Connection = executor.get_connection()

0 commit comments

Comments
 (0)