HystrixYammerMetricsPublisher

  继承HystrixMetricsPublisher,创建HystrixYammerMetricsPublisherCommand、HystrixYammerMetricsPublisherThreadPool、HystrixYammerMetricsPublisherCollapser。

 @Overridepublic HystrixMetricsPublisherCommand getMetricsPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey, HystrixCommandMetrics metrics, HystrixCircuitBreaker circuitBreaker, HystrixCommandProperties properties) {return new HystrixYammerMetricsPublisherCommand(commandKey, commandGroupKey, metrics, circuitBreaker, properties, metricsRegistry);}@Overridepublic HystrixMetricsPublisherThreadPool getMetricsPublisherForThreadPool(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, HystrixThreadPoolProperties properties) {return new HystrixYammerMetricsPublisherThreadPool(threadPoolKey, metrics, properties, metricsRegistry);}@Overridepublic HystrixMetricsPublisherCollapser getMetricsPublisherForCollapser(HystrixCollapserKey collapserKey, HystrixCollapserMetrics metrics, HystrixCollapserProperties properties) {return new HystrixYammerMetricsPublisherCollapser(collapserKey, metrics, properties, metricsRegistry);}

HystrixYammerMetricsPublisherCommand

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

例如:

protected void createExecutionLatencyPercentileGauge(final String name, final double percentile) {metricsRegistry.newGauge(createMetricName(name), new Gauge<Integer>() {@Overridepublic Integer value() {return metrics.getExecutionTimePercentile(percentile);}});}

HystrixYammerMetricsPublisherThreadPool

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

例如:

metricsRegistry.newGauge(createMetricName("rollingMaxActiveThreads"), new Gauge<Number>() {@Overridepublic Number value() {return metrics.getRollingMaxActiveThreads();}});

HystrixYammerMetricsPublisherCollapser

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

例如:

metricsRegistry.newGauge(createMetricName("shardSize_percentile_50"), new Gauge<Integer>() {@Overridepublic Integer value() {return metrics.getShardSizePercentile(50);}});

转载于:https://www.cnblogs.com/zhangwanhua/p/8192231.html

hystrix源码小贴士之Yammer Publisher相关推荐

  1. hystrix源码小贴士之中断

    execution.isolation.thread.interruptOnCancel可以设置当cancellation发生时是否需要中断.通过Future的cancel方法和线程的中断方法来实现是 ...

  2. Java熔断框架有哪些_降级熔断框架 Hystrix 源码解析:滑动窗口统计

    降级熔断框架 Hystrix 源码解析:滑动窗口统计 概述 Hystrix 是一个开源的降级熔断框架,用于提高服务可靠性,适用于依赖大量外部服务的业务系统.什么是降级熔断呢? 降级 业务降级,是指牺牲 ...

  3. hystrix 源码 线程池隔离_Spring Cloud Hystrix 源码学习合集

    # Spring Cloud Hystrix 源码学习合集 **Hystrix: Latency and Fault Tolerance for Distributed Systems** ![](h ...

  4. hystrix 源码 线程池隔离_Hystrix源码学习--线程池隔离

    分析你的系统 你所认识的分布式系统,哪些是可以进行垂直拆分的?拆分之后系统之间的依赖如何梳理?系统异构之后的稳定性调用如何保证?这些都是可能在分布式场景中面临的问题. 说个比较常见的问题,大家都知道秒 ...

  5. 熔断器 Hystrix 源码解析 —— 命令执行(三)之执行超时

    2019独角兽企业重金招聘Python工程师标准>>> 摘要: 原创出处 http://www.iocoder.cn/Hystrix/command-execute-third-ti ...

  6. Java智慧校园系统源码,智慧学校源码 +小程序+电子班牌

    Java智慧校园系统源码 智慧学校源码 小程序+电子班牌 有演示,可正常上线运营+可授权 开发环境:Java+springboot+vue+element-ui+mysql 一款集智慧教学.智慧教务. ...

  7. 自采集壁纸网站源码 - 小韩美化版

    介绍: 自采集壁纸网站源码 - 小韩美化版 网盘下载地址: https://zijiewangpan.com/jvhkDTFdngV 图片: [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下 ...

  8. Java开发多、单商户淘宝客+任务系统cps系统源码小程序app

    Java开发的多商户淘宝客.任务cps系统源码淘宝客+美团外卖+饿了么外卖+多麦CPS+京东+拼多多+多商户自营+任务墙+本地生活模块+抖音+唯品会+文娱充值+话费充值小程序app主要包括用户端.商家 ...

  9. 三. 微服务源码阅读-Hystrix 源码

    3. Hystrix 源码 1. 断路器开关 @SpringBootApplication(scanBasePackages = {"len.hgy"}) //注册到eureka ...

最新文章

  1. 自定义国内maven镜像包设置settings.xml
  2. int数组初始化_Java中到底有没有多维数组
  3. 重载操作符与转换(上)
  4. c语言程序设计多数求最大值,C语言编程问题存在三个整数,使x²+y²+z²=625,求x+y+z的最大值。这是大一C语言实验书的习题,请不要用过于复杂的算法语句...
  5. 容器学习 之 管理multi-host(十八)
  6. Twitter开发者帐号申请(还没出结果)
  7. 嵌入式linux的调试技术
  8. 手机qq音乐qmc0文件转mp3_录音添加背景音乐最新教程
  9. tp 5.0 mysql 事物
  10. Leetcode每日一题:452.minimum-number-of-arrows-to-burst-balloons(最少数量的箭引爆气球)
  11. 苹果mac最好用的视频下载软件:Downie 4
  12. Windows 系统(包含Server) 官方镜像下载--阿里云盘
  13. Kibana server is not ready yet
  14. 冰桶挑战:一个吊炸天的病毒式营销案例剖析
  15. 人民币即期汇率近六年首次跌破6.70 对国际消费影响几何
  16. 数学建模算法与应用:预测模型(3)案例: SARS 疫情对经济指标影响
  17. 认真学习InnoDB的数据存储结构中的区、段与表空间
  18. 服务提供商SD-WAN市场非常广阔
  19. delphi FastReport经验
  20. 【课件制作软件】Focusky教程 | 如何在Foucksy中添加空白页?

热门文章

  1. Unicode utf8等编码类型的原理
  2. Servlet中如何获取param-name对应的值?
  3. @EnableAspectAutoJAutoProxy_exposeProxy属性
  4. gateway集成sentinel实现网关限流
  5. 怎样远程连接服务器后上传文件,远程登录服务器后怎样上传文件
  6. php smarty 限制显示字数,smarty现在显示字数的各种写法
  7. 揭开知识库问答KB-QA的面纱3·信息抽取篇
  8. mysql新增阵列df_DF学Mysql(二)——数据表的基本操作
  9. png 转数组 工具_推荐8款实用在线制图工具
  10. equals java的用法_Java ConcurrentLinkedDeque equals()用法及代码示例