@cryptotaxi247 / netdata-1 / commits / 5271e5b38

Disable IPFS Pin API (#4224)

* Disable Pin API Disabling pin api due to ipfs performance issues with larger object Storage. Propable fix for #3156 while ipfs has not solved this issue (go-ipfs issue #3874) * Disable IPFS Pin API (#1) * Disable IPFS pin api by default Disabling pin api by default due to ipfs performance issues with larger object Storage. Propable fix for #3156 while ipfs has not solved this issue (go-ipfs issue #3874) * Disable IPFS pin api by default Disabling pin api by default due to ipfs performance issues with larger object Storage. Propable fix for #3156 while ipfs has not solved this issue (go-ipfs issue #3874) * Added Bug Link * changed pinapi Type to bool * changed pinapi Type to bool * changed pinapi Type to bool * load pinapi value correctly from conf file * move pinapi setting to correct location * modified bool style

Jan Kunz committed Sep 20, 2018 at 00:11 UTC 5271e5b38f303bd14ebf4530c21570f80adbbff7
2 files changed +13 -4
conf.d/python.d/ipfs.conf
+7 -2
@@ -64,11 +64,16 @@
64 # Additionally to the above, ipfs also supports the following:
65 #
66 # url: 'URL' # URL to the IPFS API
67 +# pinapi: no # Set status of IPFS pinned object polling
68 +# # Currently defaults to disabled due to IPFS Bug
69 +# # https://github.com/ipfs/go-ipfs/issues/3874
70 +# # resulting in very high CPU Usage
71 #
72 # ----------------------------------------------------------------------
73 # AUTO-DETECTION JOBS
74 # only one of them will run (they have the same name)
75
76 localhost:
73 - name : 'local'
74 - url : 'http://localhost:5001'
77 + name : 'local'
78 + url : 'http://localhost:5001'
79 + pinapi : no
python.d/ipfs.chart.py
+6 -2
@@ -61,6 +61,7 @@ class Service(UrlService):
61 self.order = ORDER
62 self.definitions = CHARTS
63 self.__storage_max = None
64 + self.do_pinapi = self.configuration.get('pinapi')
65
66 def _get_json(self, sub_url):
67 """
@@ -110,9 +111,12 @@ class Service(UrlService):
111 [('peers', 'Peers', len)],
112 '/api/v0/stats/repo':
113 [('size', 'RepoSize', int), ('objects', 'NumObjects', int), ('avail', 'StorageMax', self._storagemax)],
113 - '/api/v0/pin/ls':
114 - [('pinned', 'Keys', len), ('recursive_pins', 'Keys', self._recursive_pins)]
114 }
115 + if self.do_pinapi:
116 + cfg.update({
117 + '/api/v0/pin/ls':
118 + [('pinned', 'Keys', len), ('recursive_pins', 'Keys', self._recursive_pins)]
119 + })
120 r = dict()
121 for suburl in cfg:
122 in_json = self._get_json(suburl)