1414
1515
1616class HostStats (ABC ):
17- """Abstract class defining an Interface for a programm that reads statistics from a host"""
17+ """
18+ Abstract class defining an interface for a program that reads statistics from a host.
19+ """
1820
1921 @abstractmethod
2022 def __init__ (self , executor : Executor , watch_cmd : str ):
21- """Constructor
23+ """
24+ Constructor.
2225
2326 Args:
24- executor (Executor): _description_
25- watch_cmd (str): the program name to watch statistics for
27+ executor (Executor): Executor object.
28+ watch_cmd (str): Program name to watch statistics for.
2629 """
2730 pass
2831
2932 @property
3033 @abstractmethod
3134 def cpus (self ) -> int :
32- """number of cpus"""
35+ """
36+ Number of CPUs.
37+ """
3338 pass
3439
3540 @property
3641 @abstractmethod
3742 def total_ram (self ) -> int :
38- """size of ram in kB"""
43+ """
44+ Size of RAM in kB.
45+ """
3946 pass
4047
4148 @property
4249 @abstractmethod
4350 def local_file (self ) -> PathLike :
44- """Path to locally stored csv file"""
51+ """
52+ Path to locally stored CSV file.
53+ """
4554 pass
4655
4756 @abstractmethod
4857 def start (self ):
49- """Start collecting statistics"""
58+ """
59+ Start collecting statistics.
60+ """
5061 pass
5162
5263 @abstractmethod
5364 def stop (self ):
54- """Stop collecting statistics"""
65+ """
66+ Stop collecting statistics.
67+ """
5568 pass
5669
5770 @abstractmethod
5871 def cleanup (self ):
59- """Remove temporary files"""
72+ """
73+ Remove temporary files.
74+ """
6075 pass
6176
6277 @abstractmethod
6378 def get_csv (self , output_dir : PathLike ):
64- """Download the csv file containing statistics to the output_dir
79+ """
80+ Download the CSV file containing statistics to the output directory.
6581
6682 Args:
67- output_dir (PathLike): path where to copy csv to
83+ output_dir (PathLike): Path where to copy CSV to.
6884 """
6985 pass
7086
7187
7288class ProbeException (Exception ):
73- """Basic exception raised by the probe implementations"""
89+ """
90+ Basic exception raised by probe implementations.
91+ """
7492
7593
7694class ProbeInterface (ABC ):
77- """Abstract class defining common interface for all probes"""
95+ """
96+ Abstract class defining common interface for all probes.
97+ """
7898
7999 @abstractmethod
80100 def __init__ (
@@ -91,106 +111,96 @@ def __init__(
91111 cache_size ,
92112 ** kwargs ,
93113 ):
94- """Initialize the local or remote probe interface as object
95-
96- Parameters
97- ----------
98-
99- executor : lbr_testsuite.executable.Executor
100- Initialized executor object with the deployed probe.
101-
102- target : src.probe.probe_target
103- Target object for the exporter/probe
104-
105- protocols : list
106- List of the networking protocols which the probe should parse and export.
107-
108- interfaces : list(InterfaceCfg)
109- Network interfaces where the exporting process should be initiated.
110-
111- verbose : bool, optional
112- Increase verbosity of probe logs.
113-
114- mtu : int, optional
115- The maximum transmission unit to be set at the probe input.
116-
117- active_timeout : int, optional
118- Maximum duration of an ongoing flow before the probe exports it (in seconds).
119-
120- inactive_timeout : int, optional
121- Maximum duration for which a flow is kept in the probe if no new data updates it (in seconds).
122-
123- kwargs : dict
124- Additional startup arguments for specific probe variants.
114+ """
115+ Initialize the local or remote probe interface as an object.
125116
126- Raises
127- ------
128- ProbeException
129- Unable to initialize the probe.
117+ Args:
118+ executor (Executor): Initialized executor object with the deployed probe.
119+ target: Target object for the exporter/probe.
120+ protocols (list): List of networking protocols to parse and export.
121+ interfaces (list[InterfaceCfg]): Network interfaces for the exporting process.
122+ verbose (bool, optional): Increase verbosity of probe logs.
123+ mtu (int, optional): Maximum transmission unit for the probe input.
124+ active_timeout (int, optional): Maximum duration of an ongoing flow before export (seconds).
125+ inactive_timeout (int, optional): Maximum duration for which a flow is kept if no new data updates it (seconds).
126+ cache_size: Additional cache size argument.
127+ **kwargs: Additional startup arguments for specific probe variants.
128+
129+ Raises:
130+ ProbeException: Unable to initialize the probe.
130131 """
131132 raise NotImplementedError
132133
133134 @property
134135 @abstractmethod
135136 def host_statistics (self ) -> HostStats :
136- """Class with which to read statistics from the host"""
137+ """
138+ Class to read statistics from the host.
139+ """
137140 pass
138141
139142 @abstractmethod
140143 def start (self ):
141- """Start the probe."""
144+ """
145+ Start the probe.
146+ """
142147 raise NotImplementedError
143148
144149 @abstractmethod
145150 def supported_fields (self ):
146- """Get list of IPFIX fields the probe may export in its current configuration."""
151+ """
152+ Get list of IPFIX fields the probe may export in its current configuration.
153+ """
147154 raise NotImplementedError
148155
149156 @abstractmethod
150157 def get_special_fields (self ):
151- """Return dictionary of exported fields that need special evaluation."""
158+ """
159+ Return dictionary of exported fields that need special evaluation.
160+ """
152161 raise NotImplementedError
153162
154163 @abstractmethod
155164 def stop (self ):
156- """Stop the probe."""
165+ """
166+ Stop the probe.
167+ """
157168 raise NotImplementedError
158169
159170 @abstractmethod
160171 def cleanup (self ):
161- """Clean any artifacts which were created by the connector or the active probe itself."""
172+ """
173+ Clean any artifacts created by the connector or the active probe itself.
174+ """
162175 raise NotImplementedError
163176
164177 @abstractmethod
165178 def download_logs (self , directory : str ):
166- """Download logs to given directory.
179+ """
180+ Download logs to the given directory.
167181
168- Parameters
169- ----------
170- directory : str
171- Path to a local directory where logs should be stored.
182+ Args:
183+ directory (str): Path to a local directory where logs should be stored.
172184 """
173185 raise NotImplementedError
174186
175187 @abstractmethod
176188 def get_timeouts (self ) -> tuple [int , int ]:
177- """Get active and inactive timeouts of the probe (in seconds).
178-
179- Returns
180- -------
181- tuple
182- active_timeout, inactive_timeout
183189 """
190+ Get active and inactive timeouts of the probe (in seconds).
191+
192+ Returns:
193+ tuple: active_timeout, inactive_timeout
184194
195+ """
196+ raise NotImplementedError
185197 raise NotImplementedError
186198
187199 def set_prefilter (self , ip_ranges : list [str ]) -> None :
188- """Set probe input filter. Probe will drop all the traffic except specified IP ranges.
189-
190- Parameters
191- ----------
192- ip_ranges : list[str]
193- IP ranges passed by the filter.
194200 """
201+ Set probe input filter. Probe will drop all traffic except specified IP ranges.
195202
203+ Args:
204+ ip_ranges (list[str]): IP ranges passed by the filter.
205+ """
196206 raise NotImplementedError
0 commit comments