SpringCloud学习笔记(15)----Spring Cloud Netflix之Hystrix Dashboard的使用
1. 引入依赖
在前面几节中的消费者中添加pom依赖。
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
2. 在启动类上添加注解
添加@EnableHystrixDashboard 开启Dashboard。
3. 注册HystrixMetricsStreamServlet
在2.x之前的版本中,会自动注入该Servlet的,但是在2.x之后的版本,没有自动注册该Servlet。看源码的解释。
所以这里需要我们手动的注册该Servlet到容器中,代码如下:
/**
* 配置Hystrix.stream的servlet
* @return
*/
@Bean
public ServletRegistrationBean registrationBean() {
HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
registrationBean.setLoadOnStartup(1);
registrationBean.addUrlMappings("/hystrix.stream");
registrationBean.setName("HystrixMetricsStreamServlet");
return registrationBean;
}
访问http://localhost:9999/hystrix 这里是你部署dashboard服务的地址和端口,会出现如下所示界面:
这里是在你需要监控的路径后面跟上/hystrix.stream,就可以自动ping目标服务器的信息。
点击Monitor Stream 按钮,出现如下面板:
由于这里的断路器采用的策略是信号量的,所以没有线程池的信息,如果使用的是线程池策略,这里将会出现线程池的相关信息。
面板每个指标所代表的意义:
SpringCloud学习笔记(15)----Spring Cloud Netflix之Hystrix Dashboard的使用的更多相关文章
- SpringCloud学习笔记(16)----Spring Cloud Netflix之Hystrix Dashboard+Turbine集群监控
前言: 上一节中,我们使用Hystrix Dashboard,只能看到单个应用内的服务信息.在生产环境中,我们经常是集群状态,所以我们需要用到Turbine这一应用. 作用:汇总系统内的多个服务的数据 ...
- springCloud学习-消息总线(Spring Cloud Bus)
1.简介 Spring Cloud Bus 将分布式的节点用轻量的消息代理连接起来.它可以用于广播配置文件的更改或者服务之间的通讯,也可以用于监控.本文要讲述的是用Spring Cloud Bus实现 ...
- spring cloud熔断监控Hystrix Dashboard和Turbine
参考: http://blog.csdn.net/ityouknow/article/details/72625646 完整pom <?xml version="1.0" e ...
- SpringCloud学习笔记(14)----Spring Cloud Netflix之Hystrix对Feign的支持
1. Hystrix对Feign的支持 添加Feign中IUserBiz的实现类HystrixFallBack: package com.wangx.cloud.springcloud02consum ...
- SpringCloud学习笔记(13)----Spring Cloud Netflix之Hystrix断路器的隔离策略
说明 : 1.Hystrix通过舱壁模式来隔离限制依赖的并发量和阻塞扩散 2. Hystrix提供了两种隔离策略:线程池(THREAD)和信号量隔离SEMAPHORE). 1. 线程池隔离(默认策略模 ...
- SpringCloud学习笔记(12)----Spring Cloud Netflix之Hystrix断路器的流程和原理
工作流程(参考:https://github.com/Netflix/Hystrix/wiki/How-it-Works) 1. 创建一个HystrixCommand或HystrixObservabl ...
- SpringCloud学习笔记(11)----Spring Cloud Netflix之Hystrix断路器的使用
为什么会有断路器? 在微服务架构中,系 是拆分成 一个的服务单元各间通过注册与发现 的方式互相依 赖.每个单元都在不同的进程中运行, 都是通过远程调用的方式进行信 ,这样就有可能因为网络原或 是依赖服 ...
- spring cloud(Greenwich.M2) hystrix dashboard 报/actuator/hystrix.stream 404 Not Found的问题
consumer端不引用spring-boot-starter-actuator的情况 Consumer端会报Unable to connect to Command Metric Stream.新建 ...
- SpringCloud学习笔记(10)----Spring Cloud Netflix之声明式 REST客户端 -Feign的高级特性
1. Feign的默认配置 Feign 的默认配置 Spring Cloud Netflix 提供的默认实现类:FeignClientsConfiguration 解码器:Decoder feignD ...
随机推荐
- JavaScript基础知识-正则表达式
正则表达式 作用:定义一个特定的验证字符串内容规则的表达式 注:正则表达式并不是JavaScript独有的:JavaScript支持正则表达式 var a = { }; // 定义一个空对象 ...
- 分享一个正则对html标签的替换
replace_html(parm){ let self = this; return self.trim(parm.replace(new RegExp("<[^<]*> ...
- 边框的使用,border-radius,box-shadow,border-image
<html> <head> <meta charset="UTF-8"> <title></ ...
- BZOJ2440: [中山市选2011]完全平方数 容斥原理_莫比乌斯函数
emmm....... 数学题都不友好QAQ...... Code: #include <cstdio> #include <algorithm> #include <c ...
- C编译时`true' undeclared (first use in this function)
在编译C语言时有时会遇到这样的错误提示: 'true' undeclared (first use in this function) or `false' undeclared (first use ...
- css font-family 字体组
介绍图片来自: http://www.runoob.com/cssref/css-websafe-fonts.html
- myeclipse 字体设置为UTF-8
将myeclipse设置成utf-8格式的方式如下: 1.windows->Preferences打开"首选项"对话框,如图: 2.点击左侧导航树,导航到general-&g ...
- ajax异步请求获取数据,实现滚动数字的效果。
BackgroundPositionAnimate.js下载 需要导入的js: <script type="text/javascript" src="js/jqu ...
- VUE:内置指令与自定义指令
VUE:内置指令与自定义指令 常用的内置指令 1)v:text 更新元素的 textContent 2)v-html 更新元素的 innerHTML 3)v-if 如果为true,当前标签才会输出到页 ...
- 1、koa的安装,get和post方法的基础使用
koa是干什么:koa是用来解决回调嵌套的方案,减少异步回调,提高代码的可读性和可维护性同时也改进了错误处理( Express的错误处理相当糟糕) koa相比express的优点在哪里1.更加优雅简单 ...