def sendall(self, *metrics) -> dict:
logger.debug("Send metrics:\n %s", '\n'.join(str(m) for m in metrics))
response = self.connect.post(
self.tsdb_urls.put,
data=gzip.compress(json.dumps(metrics).encode()) if self.compression else json.dumps(metrics),
timeout=self.SEND_TIMEOUT)
return response.json()
评论列表
文章目录