@cryptotaxi247 / netdata-1 / commits / 8a4e7a545

Use new API. Optimize request number and patch json parsing.

Use new API. Optimize request number and patch json parsing.

Unknown committed Apr 5, 2018 at 10:58 UTC 8a4e7a54561a24f34fa03411015fa767c49bdb36
1 file changed +4 -5
python.d/ipfs.chart.py
+4 -5
@@ -93,7 +93,7 @@ class Service(UrlService):
93
94 def _storagemax(self, store_cfg):
95 if self.__storage_max is None:
96 - self.__storage_max = self._dehumanize(store_cfg['StorageMax'])
96 + self.__storage_max = self._dehumanize(store_cfg)
97 return self.__storage_max
98
99 def _get_data(self):
@@ -106,12 +106,11 @@ class Service(UrlService):
106 '/api/v0/stats/bw':
107 [('in', 'RateIn', int), ('out', 'RateOut', int)],
108 '/api/v0/swarm/peers':
109 - [('peers', 'Strings', len)],
109 + [('peers', 'Peers', len)],
110 '/api/v0/stats/repo':
111 - [('size', 'RepoSize', int), ('objects', 'NumObjects', int)],
111 + [('size', 'RepoSize', int), ('objects', 'NumObjects', int), ('avail', 'StorageMax', self._storagemax)],
112 '/api/v0/pin/ls':
113 - [('pinned', 'Keys', len), ('recursive_pins', 'Keys', self._recursive_pins)],
114 - '/api/v0/config/show': [('avail', 'Datastore', self._storagemax)]
113 + [('pinned', 'Keys', len), ('recursive_pins', 'Keys', self._recursive_pins)]
114 }
115 r = dict()
116 for suburl in cfg: