概述
测试中使用到的代码到在这里https://download.csdn.net/download/zhou920786312/10853300
Hystrix-Dashboard介绍
- 实时监控Hystrix的各项指标信息
- 是Hystrix的仪表盘组件
- 可以快速发现系统中存在的问题
- 通过实时监控来动态修改配置,直到满意为止
- 总而言之:就是页面监控工具
案例
microservicecloud-consumer-hystrix-dashboard-9001
@SpringBootApplication
//开启HystrixDashboard
@EnableHystrixDashboard
public class DeptConsumer_DashBoard_App_9001
{
public static void main(String[] args)
{
SpringApplication.run(DeptConsumer_DashBoard_App_9001.class, args);
}
}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.atguigu.springcloud</groupId>
<artifactId>microservicecloud</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>microservicecloud-consumer-hystrix-dashboard-9001</artifactId>
<dependencies>
<!-- 自己定义的api -->
<dependency>
<groupId>com.atguigu.springcloud</groupId>
<artifactId>microservicecloud-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- 修改后立即生效,热部署 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<!-- Ribbon相关 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-ribbon</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<!-- feign相关 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
</dependency>
<!-- hystrix和 hystrix-dashboard相关 -->
<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>
</dependencies>
</project>
测试1-启动监控服务
如果如下面显示,表示监控程序启动成功。
http://localhost:9001/hystrix
测试2-启动监控服务+被监控的服务+3个eureka
microservicecloud-consumer-hystrix-dashboard-9001
microservicecloud-provider-dept-hystrix-8001
microservicecloud-provider-dept-hystrix-8001的POM
<!-- actuator监控信息完善 与Hystrix-Dashboard配合使用-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
查看8001服务
方式1
方式2
图分析
最后
以上就是爱笑水池为你收集整理的Hystrix-Dashboard介绍+案例+图分析Hystrix-Dashboard介绍案例microservicecloud-consumer-hystrix-dashboard-9001测试1-启动监控服务测试2-启动监控服务+被监控的服务+3个eureka的全部内容,希望文章能够帮你解决Hystrix-Dashboard介绍+案例+图分析Hystrix-Dashboard介绍案例microservicecloud-consumer-hystrix-dashboard-9001测试1-启动监控服务测试2-启动监控服务+被监控的服务+3个eureka所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复