From ffe6418392b3c0d50e387a8a80a0a54aef5f89bb Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 17 Jul 2019 22:40:02 -0400 Subject: [PATCH] fix metrics json response test --- lbry/lbry/wallet/server/metrics.py | 4 ++-- lbry/tests/unit/wallet/server/test_metrics.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lbry/lbry/wallet/server/metrics.py b/lbry/lbry/wallet/server/metrics.py index 1a55bd70c..95fd960bc 100644 --- a/lbry/lbry/wallet/server/metrics.py +++ b/lbry/lbry/wallet/server/metrics.py @@ -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 = {} diff --git a/lbry/tests/unit/wallet/server/test_metrics.py b/lbry/tests/unit/wallet/server/test_metrics.py index b252953e9..63a2bc75f 100644 --- a/lbry/tests/unit/wallet/server/test_metrics.py +++ b/lbry/tests/unit/wallet/server/test_metrics.py @@ -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': {}})