springcloud hystrix dashboard使用

什么是hystrix dashboard

hystrix dashboard是一款由netfilx提供的,基于hystrix Commond,并将hystrix commond收集到的服务健康信息以图形化展示的界面工具

hystrix dashboard的主要作用

1、监控各个hystrixcommand的各种值。 2、通过dashboards的实时监控来动态修改配置,直到满意为止

hystrix仪表盘图形界面参数简介

1、圆形颜色和大小:代表健康情况和流量 2、折线:2分钟内的吞吐率变化情况 3、hosts:集群中节点个数 4、median: 每个请求时间的中位数 5、mean: 平均每个请求消耗的时间 6、subscriberGetAccount: 绿200545:代表成功请求数量 蓝0:代表断路数量 黄19:代表表超时的线程数量 紫94:代表线程池拒绝次数,即线程不够用 红0: 失败或异常数量 灰0%: 最后10秒错误率 7、host: 各节点每秒的平均请求吞吐量 8、cluster: 集群每秒的请求吞吐量 9、circuit:代表断路器状态即:是否打开断路器 90th,99th,99.5th: 最后1分钟各种延迟的百分比。如图:90%的请求小于10ms;而99%的请求小于44ms,99.5%的请求在61ms完成。

hystrix dashboard项目搭建

1、引入maven依赖

<dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

最新版的则为

<dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-hystrix-netflix-dashboard</artifactId>
    </dependency>
 
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

2、创建启动类

@SpringBootApplication
@EnableHystrixDashboard
public class HystrixDashBoard {

    private static Logger logger = LoggerFactory.getLogger(HystrixDashBoard.class);

    public static void main(String[] args) {
        SpringApplication.run(HystrixDashBoard.class, args);
    }
}

3、配置

server:
  port: 7300

4、启动

浏览器输入

http://localhost:7300/hystrix

5、监控单节点服务信息例子

仪表盘输入

形如:http://hystrix-app:port/hystrix.stream ,然后点击monitor stream

小结

以上就是hystrix dashboard的简单入门,hystrix dashboard 监控单节点的意义的不是很大,下一节介绍何如用turbine汇总系统内多个服务的数据并显示到Hystrix Dashboard上

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章