MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / collectGlobal

Method collectGlobal

plugins/Chart/ChartCollector.py:138–151  ·  view source on GitHub ↗
(self, collectors, last_values)

Source from the content-addressed store, hash-verified

136 return datas
137
138 def collectGlobal(self, collectors, last_values):
139 now = int(time.time())
140 s = time.time()
141 datas = self.collectDatas(collectors, last_values["global"])
142 values = []
143 for key, value in datas.items():
144 values.append((self.db.getTypeId(key), value, now))
145 self.log.debug("Global collectors done in %.3fs" % (time.time() - s))
146
147 s = time.time()
148 cur = self.db.getCursor()
149 cur.cursor.executemany("INSERT INTO data (type_id, value, date_added) VALUES (?, ?, ?)", values)
150 cur.close()
151 self.log.debug("Global collectors inserted in %.3fs" % (time.time() - s))
152
153 def collectSites(self, sites, collectors, last_values):
154 now = int(time.time())

Callers 1

collectorMethod · 0.95

Calls 5

collectDatasMethod · 0.95
itemsMethod · 0.80
getTypeIdMethod · 0.80
getCursorMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected