def replace(self,
registry: CollectorRegistry) -> aiohttp.web.Response:
'''
``replace`` pushes new values for a group of metrics to the push
gateway.
.. note::
All existing metrics with the same grouping key specified in the
URL will be replaced with the new metrics value.
'''
async with aiohttp.ClientSession(loop=self.loop) as session:
payload = self.formatter.marshall(registry)
resp = await session.put(
self.path, data=payload, headers=self.headers)
await resp.release()
return resp
评论列表
文章目录