Hystrix Dashboard 仪表盘是根据系统一段时间内发生的请求情况来展示的可视化面板,这些信息是每个 HystrixCommand 执行过程中的信息,这些信息是一个指标集合和具体的系统运行情况。
这里在原有的基础上新建一个 Hystrix Dashboard 工程。
引入依赖 <!-- Spring Cloud Hystrix Dashboard --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId> </dependency> 启动类上 /** 开启 Hystrix Dashboard 监控功能 */ @EnableHystrixDashboard 在 demo-order 项目中引入依赖 <!-- 内省 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> 在 demo-order 项目中开启访问端口 ### 端点控制 management: endpoints: web: exposure: # 开启指定端点 include: 'hystrix.stream'访问 Hystrix Dashboard 项目:http://localhost:8080/hystrix
监控 demo-order 项目:
访问几下观察:
Hystrix Dashboard 页面左边第1列数字代表了请求的成功,熔断数,错误的请求,超时的请求,线程池拒绝数,失败的请求和最近10秒内错误的比率,如下图:。
Host&Cluster:代表机器和集群的请求频率。Circuit:断路器状态,open/closed。Hosts&Median&Mean&:集群下的报告,百分位延迟数。Thread Pools:线程池的指标,核心线程池指标,队列大小等。源码:https://github.com/SlowSlicing/demo-spring-cloud-finchley/tree/HystrixDashboard