endpoints.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:talisker 作者: canonical-ols 项目源码 文件源码
def test_prometheus(self, request):
        """Increment prometheus metric for testing"""
        if not pkg_is_installed('prometheus-client'):
            return Response('Not Supported', status=501)

        if not hasattr(self, 'test_counter'):
            import prometheus_client
            self.test_counter = prometheus_client.Counter('test', 'test')
        self.test_counter.inc()
        return Response('Incremented test counter')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号