hystrix源码小贴士之Servo Publisher

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中。 

posted @ 2018-01-04 12:33  zwh1988  阅读(220)  评论(0编辑  收藏  举报