8
8
Define interface for accessing pipeline runtime of (DPDK) application.
9
9
"""
10
10
11
+ from abc import ABC , abstractmethod
11
12
12
- class PipelineRuntime :
13
+
14
+ class PipelineRuntime (ABC ):
13
15
"""Interface for accessing pipeline runtime."""
14
16
17
+ @abstractmethod
15
18
def get_pid (self ):
16
19
pass
17
20
21
+ @abstractmethod
18
22
def get_pipeline_names (self ) -> list [str ]:
19
23
pass
20
24
25
+ @abstractmethod
21
26
def get_worker_status (self , worker_id : int , name : str = None ):
22
27
"""Obtain worker's status in the selected pipeline.
23
28
@@ -31,6 +36,7 @@ def get_worker_status(self, worker_id: int, name: str = None):
31
36
32
37
pass
33
38
39
+ @abstractmethod
34
40
def get_workers_count (self , name : str = None ):
35
41
"""Obtain count of workers of the selected pipeline.
36
42
@@ -42,6 +48,7 @@ def get_workers_count(self, name: str = None):
42
48
43
49
pass
44
50
51
+ @abstractmethod
45
52
def get_pipeline_stage_names (self , name : str = None ) -> list [str ]:
46
53
"""Obtain list of stage names of the selected pipeline.
47
54
@@ -53,9 +60,11 @@ def get_pipeline_stage_names(self, name: str = None) -> list[str]:
53
60
54
61
pass
55
62
63
+ @abstractmethod
56
64
def wait_until_active (self , timeout = 5 ):
57
65
pass
58
66
67
+ @abstractmethod
59
68
def get_worker_chain_status (self , worker_id : int , name : str = None ) -> dict :
60
69
"""Obtain worker's chain status in the selected pipeline.
61
70
@@ -69,6 +78,7 @@ def get_worker_chain_status(self, worker_id: int, name: str = None) -> dict:
69
78
70
79
pass
71
80
81
+ @abstractmethod
72
82
def get_stats (self ) -> dict :
73
83
"""Obtain pipeline's statistics across all ports.
74
84
@@ -81,6 +91,7 @@ def get_stats(self) -> dict:
81
91
82
92
pass
83
93
94
+ @abstractmethod
84
95
def get_xstats (self ) -> dict :
85
96
"""Obtain pipeline's extended statistics across all ports.
86
97
@@ -93,6 +104,7 @@ def get_xstats(self) -> dict:
93
104
94
105
pass
95
106
107
+ @abstractmethod
96
108
def get_mempool_stats (self ) -> list [dict ]:
97
109
"""Obtain statistics of mempools in the underlying application if any.
98
110
Each mempool is identified by a unique name.
0 commit comments