1.什么是Dashboard

Hystrix-dashboard 是一款针对 Hystrix 进行实时监控的工具页面,通过 Hystrix Dashboard 我们可以在直观地看到各 Hystrix Command 的请求响应时间, 请求成功率等数据。

2.如何配置Dashboard——监控服务

1.导入依赖

<!--Hystrix依赖-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
<version>1.4.6.RELEASE</version>
</dependency>
<!--dashboard依赖-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
<version>1.4.6.RELEASE</version>
</dependency>

2配置文件配置端口号

server:
prot: 8899 # 端口号可以自行配置 只要是和别的服务的端口号不冲突就好

3.启动服务------Dashboard 作为一个独立的服务存在

@SpringBootApplication
// 开启Dashboard
@EnableHystrixDashboard
public class DeptConsumerDashboard {
public static void main(String[] args) {
SpringApplication.run(DeptConsumerDashboard.class,args);
}
}

3.被监控服务

1.添加监控信息依赖

添加监控注解
<!--actuator 完善监控信息 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

2.在被监控的服务启动类上添加一个servlet

//增加一个Servlet
@Bean
public ServletRegistrationBean hystrixMetricsStreamServlet(){
ServletRegistrationBean registrationBean = new ServletRegistrationBean(new HystrixMetricsStreamServlet());
//参数固定写法
registrationBean.addUrlMappings("/actuator/hystrix.stream");
return registrationBean;
}

效果图

最新文章

  1. CYQ.Data、ASP.NET Aries 百家企业使用名单
  2. asp.net留言板项目源代码下载
  3. 交叉编译总结 libosscore.a libcurl.a libmysqlclient.a
  4. NSLOOKUP命令使用
  5. fork与vfork的区别与联系
  6. 【UER #1】[UOJ#12]猜数 [UOJ#13]跳蚤OS [UOJ#14]DZY Loves Graph
  7. 【caffe-windows】 caffe-master 之 mnist 超详细
  8. 1 . Robberies (hdu 2955)
  9. Linux下用hostapd架无线AP
  10. hdu 5445 Food Problem 多重背包
  11. 2015年10月22日CSS学习笔记
  12. @property 的本质是什么?ivar、getter、setter 是如何生成并添加到这个类中的
  13. GNU自动补全模块readline解析
  14. 语法糖(Syntactic sugar)
  15. 可编辑的表格:jQuery+PHP实现实时编辑表格字段内容
  16. 832B Petya and Exam
  17. [转] 深入浅出mongoose-----包括mongoose基本所有操作,非常实用!!!!!
  18. luogu P1357 花园
  19. 大数据处理框架之Strom:redis storm 整合
  20. sgu 191 Exhibition

热门文章

  1. 【Tool】Node.js 安装
  2. Spring Cloud Alibaba微服务一站式解决方案-开篇v2.2.1.RELEASE
  3. c语言用指针交换两个变量
  4. Atcoder Grand Contest 023 E - Inversions(线段树+扫描线)
  5. 洛谷 P4564 [CTSC2018]假面(期望+dp)
  6. 【豆科基因组】小豆(红豆)adzuki bean, Vigna angularis基因组2015
  7. miRNA分析--比对(二)
  8. MariaDB—备份数据库
  9. 简易kmeans-c++版本
  10. (数据科学学习手札132)Python+Fabric实现远程服务器连接