fix metrics json response test
This commit is contained in:
parent
88adf3ee27
commit
ffe6418392
2 changed files with 3 additions and 3 deletions
|
@ -120,11 +120,11 @@ class ServerLoadData:
|
|||
self._apis[name] = APICallMetrics(name)
|
||||
return self._apis[name]
|
||||
|
||||
def to_json_and_reset(self, server):
|
||||
def to_json_and_reset(self, status):
|
||||
try:
|
||||
return {
|
||||
'api': {name: api.to_json_and_reset() for name, api in self._apis.items()},
|
||||
'server': server
|
||||
'status': status
|
||||
}
|
||||
finally:
|
||||
self._apis = {}
|
||||
|
|
|
@ -59,4 +59,4 @@ class TestCollectingMetrics(unittest.TestCase):
|
|||
'wait_avg': 12,
|
||||
'wait_percentiles': (10, 10, 10, 12, 14, 15, 15)
|
||||
}}})
|
||||
self.assertEqual(load.to_json_and_reset({}), {'api': {}})
|
||||
self.assertEqual(load.to_json_and_reset({}), {'status': {}, 'api': {}})
|
||||
|
|
Loading…
Add table
Reference in a new issue