88Define interface for accessing pipeline runtime of (DPDK) application.
99"""
1010
11+ from abc import ABC , abstractmethod
1112
12- class PipelineRuntime :
13+
14+ class PipelineRuntime (ABC ):
1315 """Interface for accessing pipeline runtime."""
1416
17+ @abstractmethod
1518 def get_pid (self ):
1619 pass
1720
21+ @abstractmethod
1822 def get_pipeline_names (self ) -> list [str ]:
1923 pass
2024
25+ @abstractmethod
2126 def get_worker_status (self , worker_id : int , name : str = None ):
2227 """Obtain worker's status in the selected pipeline.
2328
@@ -31,6 +36,7 @@ def get_worker_status(self, worker_id: int, name: str = None):
3136
3237 pass
3338
39+ @abstractmethod
3440 def get_workers_count (self , name : str = None ):
3541 """Obtain count of workers of the selected pipeline.
3642
@@ -42,6 +48,7 @@ def get_workers_count(self, name: str = None):
4248
4349 pass
4450
51+ @abstractmethod
4552 def get_pipeline_stage_names (self , name : str = None ) -> list [str ]:
4653 """Obtain list of stage names of the selected pipeline.
4754
@@ -53,9 +60,11 @@ def get_pipeline_stage_names(self, name: str = None) -> list[str]:
5360
5461 pass
5562
63+ @abstractmethod
5664 def wait_until_active (self , timeout = 5 ):
5765 pass
5866
67+ @abstractmethod
5968 def get_worker_chain_status (self , worker_id : int , name : str = None ) -> dict :
6069 """Obtain worker's chain status in the selected pipeline.
6170
@@ -69,6 +78,7 @@ def get_worker_chain_status(self, worker_id: int, name: str = None) -> dict:
6978
7079 pass
7180
81+ @abstractmethod
7282 def get_stats (self ) -> dict :
7383 """Obtain pipeline's statistics across all ports.
7484
@@ -81,6 +91,7 @@ def get_stats(self) -> dict:
8191
8292 pass
8393
94+ @abstractmethod
8495 def get_xstats (self ) -> dict :
8596 """Obtain pipeline's extended statistics across all ports.
8697
@@ -93,6 +104,7 @@ def get_xstats(self) -> dict:
93104
94105 pass
95106
107+ @abstractmethod
96108 def get_mempool_stats (self ) -> list [dict ]:
97109 """Obtain statistics of mempools in the underlying application if any.
98110 Each mempool is identified by a unique name.
0 commit comments