Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
except:
pass
+ metricMap = {
+ 'connects': 2,
+ 'http/1.1': 3,
+ 'http/2': 4,
+ }
+
def getHTTPCounter(self, name):
lines = self.sendConsoleCommand("showDOHFrontends()").splitlines()
self.assertEqual(len(lines), 2)
metrics = lines[1].split()
self.assertEqual(len(metrics), 15)
- if name == 'connects':
- return int(metrics[2])
- if name == 'http/1.1':
- return int(metrics[3])
- if name == 'http/2':
- return int(metrics[4])
+ return int(metrics[metricMap[name]])
def testDOHHTTP1(self):
"""