一、基本方式

  • hystrix为每一个commandKey提供了计数器

二、实现流程

  • https://raw.githubusercontent.com/wiki/Netflix/Hystrix/images/metrics-generation.png

三、Hystrix event types

1、什么情况下会触发fallback方法?

2、fallback方法在什么情况下会抛出异常

四、metrics storage

1、实现原理

  • 当计数结果(metrics)产生之后,这些结果会在被推到其他系统中前存储一段时间。

2、存储结构

  • hystrix会将计数结果存储在内存数据结构里(in-memory data structures)。这个数据结构在1.5.0之后进行了改变。

2.1、高于1.4.x版本

  • HystrixRollingNumber记录events("三"中)的counts(HystrixCommandMetrics的父类HystrixMetrics的属性)
  • HystrixRollingPercentile记录感兴趣的分布的数量。例如:记录command的延迟,collapser的批量size。(HystrixCommandMetrics的属性)

注意:

  • 当command执行时,计数结果会被同步写到如上的两个数据结构中。
  • 如果该command是多个线程在执行,HystrixRollingNumber和HystrixRollingPercentile内部会有一个同步逻辑来达到线程安全(我们不需要再外部去做线程安全处理)
  • 以上这两个数据结构支持滚动模型,即只保存最新的值(而metrics会根据配置保存多个值,比如保存每一秒的值)

2.2、HystrixRollingNumber

当执行一个command的时候,HystrixRollingNumber会被初始化

五、metrics reads

1、所有hystrix-contrib中的metrics publishers and streams可以从上述的数据结构中读取信息。

2、数据结构只存储了最新的值,我们想看之前的值,只能通过分析HystrixRequestLog

3、The HystrixRequestLog tracks all events in a request, and makes them available as a string。

六、metrics event stream

1、原理

  • 只要客户端连接还连着,hystrix-metrics-event-stream就会不断的向客户端以text/event-stream的形式推送计数结果(metrics)

2、

七、metrics publisher

附6 hystrix metrics and monitor的更多相关文章

  1. 【附6】hystrix metrics and monitor

    一.基本方式 hystrix为每一个commandKey提供了计数器 二.实现流程 https://raw.githubusercontent.com/wiki/Netflix/Hystrix/ima ...

  2. 附2 hystrix详述(2)- 配置

    一.hystrix在生产中的建议 1.保持timeout的默认值(1000ms),除非需要修改(其实通常会修改) 2.保持threadpool的的线程数为10个,除非需要更多 3.依赖标准的报警和监控 ...

  3. 附1 hystrix详述(1)

    一.hystrix的作用 控制被依赖服务的延时和失败 防止在复杂系统中的级联失败 可以进行快速失败(不需要等待)和快速恢复(当依赖服务失效后又恢复正常,其对应的线程池会被清理干净,即剩下的都是未使用的 ...

  4. 第二十五章 springboot + hystrixdashboard

    注意: hystrix基本使用:第十九章 springboot + hystrix(1) hystrix计数原理:附6 hystrix metrics and monitor 一.hystrixdas ...

  5. 【第二十五章】 springboot + hystrixdashboard

    注意: hystrix基本使用:第十九章 springboot + hystrix(1) hystrix计数原理:附6 hystrix metrics and monitor 一.hystrixdas ...

  6. hystrix(2) metrics

    上一节讲到了hystrix提供的五个功能,这一节我们首先来讲hystrix中提供实时执行metrics信息的实现.为什么先讲metrics,因为很多功能都是基于metrics的数据来实现的,它是很多功 ...

  7. hystrix文档翻译之metrics

     metrics和监控 动机 HystrixCommands和HystrixObservableCommands执行过程中会产生相关运行情况的metrics.这些metrics对于监控系统表现有很大的 ...

  8. .NET Core微服务之基于Steeltoe使用Hystrix熔断保护与监控

    Tip: 此篇已加入.NET Core微服务基础系列文章索引 =>  Steeltoe目录快速导航: 1. 基于Steeltoe使用Spring Cloud Eureka 2. 基于Steelt ...

  9. Spring Cloud(六):Hystrix 监控数据聚合 Turbine【Finchley 版】

    Spring Cloud(六):Hystrix 监控数据聚合 Turbine[Finchley 版]  发表于 2018-04-17 |  更新于 2018-05-07 |  上一篇我们介绍了使用 H ...

随机推荐

  1. Eclipse 更改默认的编码 和 换行符

  2. [leetcode sort]57. Insert Interval

    Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessa ...

  3. iOS 11开发教程(六)iOS11Main.storyboard文件编辑界面

    iOS 11开发教程(六)iOS11Main.storyboard文件编辑界面 在1.2.2小节中提到过编辑界面(Interface builder),编辑界面是用来设计用户界面的,单击打开Main. ...

  4. 1022 Digital Library (30)(30 point(s))

    problem A Digital Library contains millions of books, stored according to their titles, authors, key ...

  5. android view surfaceView GLSurfaceView

    韩梦飞沙  韩亚飞  313134555@qq.com  yue31313  han_meng_fei_sha 表面视图 SurfaceView 是 视图 的子类, 刷新界面速度比 视图 块, 因为它 ...

  6. BZOJ.3498.[PA2009]Cakes(三元环 枚举)

    题目链接 感觉我可能学的假的(复杂度没问题,但是常数巨大). 一个比较真的说明见这儿:https://czyhe.me/blog/algorithm/3-mem-ring/3-mem-ring/. \ ...

  7. Vuex了解

    State Vuex是用来管理某个应用的整个状态,那么一个应用只能有一个Vuex实例.和React一样,Vuex也不允许直接去修改state,而是通过提交mutation,来触发状态变更.Vuex的状 ...

  8. python及其模块下载集合

    1)python平台 https://www.python.org/downloads/ 2)打包工具 cx-freeze(python3以上版本打包工具) http://cx-freeze.sour ...

  9. Spring源码解析 – @Configuration配置类及注解Bean的解析

    在分析Spring 容器创建过程时,我们知道容器默认会加载一些后置处理器PostPRocessor,以AnnotationConfigApplicationContext为例,在构造函数中初始化rea ...

  10. LM358资料及引脚图

    LM358里面包括有两个高增益.独立的.内部频率补偿的双运放,适用于电压范围很宽的单电源,而且也适用于双电源工作方式,它的应用范围包括传感放大器.直流增益模块和其他所有可用单电源供电的使用运放的地方使 ...