MCPcopy Create free account
hub / github.com/F-Stack/f-stack / interactiveMenu

Method interactiveMenu

dpdk/usertools/dpdk-telemetry-client.py:106–132  ·  view source on GitHub ↗
(self, sleep_time)

Source from the content-addressed store, hash-verified

104 print("\nResponse: \n", data)
105
106 def interactiveMenu(self, sleep_time):
107 # Creates Interactive menu within the script
108 while self.choice != 4:
109 print("\nOptions Menu")
110 print("[1] Send for Metrics for all ports")
111 print("[2] Send for Metrics for all ports recursively")
112 print("[3] Send for global Metrics")
113 print("[4] Unregister client")
114
115 try:
116 self.choice = int(input("\n:"))
117 # Removes the user input for screen, cleans it up
118 print("\033[F")
119 print("\033[K")
120 if self.choice == 1:
121 self.requestMetrics()
122 elif self.choice == 2:
123 self.repeatedlyRequestMetrics(sleep_time)
124 elif self.choice == 3:
125 self.requestGlobalMetrics()
126 elif self.choice == 4:
127 self.unregister()
128 self.unregistered = 1
129 else:
130 print("Error - Invalid request choice")
131 except:
132 pass
133
134
135def get_dpdk_runtime_dir(fp):

Callers 1

Calls 6

requestMetricsMethod · 0.95
requestGlobalMetricsMethod · 0.95
unregisterMethod · 0.95
printFunction · 0.50
inputClass · 0.50

Tested by

no test coverage detected