码迷,mamicode.com
首页 > 其他好文 > 详细

hystrix源码小贴士之Servo Publisher

时间:2018-01-04 13:09:38      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:try   metrics   erp   man   registry   ret   comm   ndk   err   

HystrixServoMetricsPublisher

  继承HystrixMetricsPublisher,创建HystrixServoMetricsPublisherCommand、HystrixServoMetricsPublisherThreadPool、HystrixServoMetricsPublisherCollapser。

    @Override
    public HystrixMetricsPublisherCommand getMetricsPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey, HystrixCommandMetrics metrics, HystrixCircuitBreaker circuitBreaker, HystrixCommandProperties properties) {
        return new HystrixServoMetricsPublisherCommand(commandKey, commandGroupKey, metrics, circuitBreaker, properties);
    }

    @Override
    public HystrixMetricsPublisherThreadPool getMetricsPublisherForThreadPool(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, HystrixThreadPoolProperties properties) {
        return new HystrixServoMetricsPublisherThreadPool(threadPoolKey, metrics, properties);
    }

    @Override
    public HystrixMetricsPublisherCollapser getMetricsPublisherForCollapser(HystrixCollapserKey collapserKey, HystrixCollapserMetrics metrics, HystrixCollapserProperties properties) {
        return new HystrixServoMetricsPublisherCollapser(collapserKey, metrics, properties);
    }

HystrixServoMetricsPublisherCommand

  从HystrixCommandMetrics获取数据,然后设置到DefaultMonitorRegistry中。

HystrixServoMetricsPublisherThreadPool

   从HystrixThreadPoolMetrics获取数据,然后设置到DefaultMonitorRegistry中。

HystrixServoMetricsPublisherCollapser

  从HystrixCollapserMetrics获取数据,然后设置到DefaultMonitorRegistry中。 

hystrix源码小贴士之Servo Publisher

标签:try   metrics   erp   man   registry   ret   comm   ndk   err   

原文地址:https://www.cnblogs.com/zhangwanhua/p/8192215.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!