使用Hystrix Dashboard可视化监控数据

之前讨论了Hystrix的监控,但访问/hystrix.stream端点获得的数据是以文字形式展示的。很难通过这些数据,一眼看到系统当前的运行状态。
可使用Hystrix Dashboard,从而让监控数据图形化,可视化。
下面通过一个例子说明。
一 创建项目microservice-hystrix-dashboard
二 为项目添加下面依赖
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
    </dependency>
三 编写启动类,在启动类上添加@EnableHystrixDashboard
package com.itmuch.cloud.study;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;

@SpringBootApplication
@EnableHystrixDashboard
public class HystrixDashboardApplication {
  public static void main(String[] args) {
    SpringApplication.run(HystrixDashboardApplication.class, args);
  }
}
四 在配置文件中添加如下内容
server:
  port: 8030
五 测试 
1 启动该项目
2 访问http://localhost:8030/hystrix,可以看到Hystrix Dashboard的主页
3 在该主页中,地址栏中输入http://localhost:8020/hystrix.stream,随意设置一个title,并点击Monitor Stream按钮,将看到下面界面
4 界面说明
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值