🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
Hystrix-dashboard是一款针对Hystrix进行实时监控的工具,通过Hystrix Dashboard我们可以在直观地看到各Hystrix Command的请求响应时间, 请求成功率等数据。 * [ ] Hystrix Dashboard 1、添加依赖 ``` <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId> </dependency> <dependency> <groupId>com.netflix.hystrix</groupId> <artifactId>hystrix-javanica</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> ``` 2、在启动类上加上注解 ``` @EnableHystrixDashboard public class OrderApplication { public static void main(String[] args) { SpringApplication.run(OrderApplication.class, args); } } ``` 3、在浏览器中进行访问 ![](https://box.kancloud.cn/3e3b52e6bbe1e0d39c7c411f67c32c2f_1137x645.png) 在输入框中填入相关信息: :-: ![](https://box.kancloud.cn/a76c1e440e50047d3594ac96ca0eb9fc_971x605.png) 选择单机版:http://hystrix-app:port/actuator/hystrix.stream 填写对应的端口和ip,时间和应用名,即可进入主界面 :-: ![](https://box.kancloud.cn/815fe6f48a98359ced0c48b8690ec674_1134x482.png) 访问下熔断的接口: :-: ![](https://box.kancloud.cn/283eb172422c8c3a3aa7def70e8adc3f_1144x595.png) 使用postman压力测试: :-: ![](https://box.kancloud.cn/573ddc965d1736b76ec585a4ded5a58f_1251x739.png) 结果: :-: ![](https://box.kancloud.cn/03579f0a19e26834304127cb5a808439_1133x710.png) 错误次数累计,开始熔断打开: :-: ![](https://box.kancloud.cn/0befccff3651337caf2be0789fa92909_1136x653.png)