首页 > 其他 > 详细

hystrix源码小贴士之Servo Publisher

时间:2018-01-04 12:57:28      阅读:311      评论:0      收藏:0      [点我收藏+]

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!