Hystrix 监控可视化页面——Dashboard 流监控
2024-09-03 23:02:06
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;
}
效果图
最新文章
- CYQ.Data、ASP.NET Aries 百家企业使用名单
- asp.net留言板项目源代码下载
- 交叉编译总结 libosscore.a libcurl.a libmysqlclient.a
- NSLOOKUP命令使用
- fork与vfork的区别与联系
- 【UER #1】[UOJ#12]猜数 [UOJ#13]跳蚤OS [UOJ#14]DZY Loves Graph
- 【caffe-windows】 caffe-master 之 mnist 超详细
- 1 . Robberies (hdu 2955)
- Linux下用hostapd架无线AP
- hdu 5445 Food Problem 多重背包
- 2015年10月22日CSS学习笔记
- @property 的本质是什么?ivar、getter、setter 是如何生成并添加到这个类中的
- GNU自动补全模块readline解析
- 语法糖(Syntactic sugar)
- 可编辑的表格:jQuery+PHP实现实时编辑表格字段内容
- 832B Petya and Exam
- [转] 深入浅出mongoose-----包括mongoose基本所有操作,非常实用!!!!!
- luogu P1357 花园
- 大数据处理框架之Strom:redis storm 整合
- sgu 191 Exhibition
热门文章
- 【Tool】Node.js 安装
- Spring Cloud Alibaba微服务一站式解决方案-开篇v2.2.1.RELEASE
- c语言用指针交换两个变量
- Atcoder Grand Contest 023 E - Inversions(线段树+扫描线)
- 洛谷 P4564 [CTSC2018]假面(期望+dp)
- 【豆科基因组】小豆(红豆)adzuki bean, Vigna angularis基因组2015
- miRNA分析--比对(二)
- MariaDB—备份数据库
- 简易kmeans-c++版本
- (数据科学学习手札132)Python+Fabric实现远程服务器连接