zoukankan      html  css  js  c++  java
  • feign hystrix加仪表盘

    Hystrix-dashboard是一款针对Hystrix进行实时监控的工具,通过Hystrix Dashboard我们可以在直观地看到各Hystrix Command的请求响应时间, 请求成功率等数据。但是只使用Hystrix Dashboard的话, 你只能看到单个应用内的服务信息, 这明显不够. 我们需要一个工具能让我们汇总系统内多个服务的数据并显示到Hystrix Dashboard上, 这个工具就是Turbine.

    Hystrix Dashboard

    我们在熔断示例项目spring-cloud-consumer-hystrix的基础上更改,重新命名为:spring-cloud-consumer-hystrix-dashboard。

    1、添加依赖

    <dependency>
    	<groupId>org.springframework.cloud</groupId>
    	<artifactId>spring-cloud-starter-hystrix</artifactId>
    </dependency>
    <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>
    

    这三个包必须添加

    2、启动类

    启动类添加启用Hystrix Dashboard和熔断器

    @SpringBootApplication
    @EnableDiscoveryClient
    @EnableFeignClients
    @EnableHystrixDashboard @EnableCircuitBreaker public class ConsumerApplication { public static void main(String[] args) { SpringApplication.run(ConsumerApplication.class, args); } }

    3、测试

    启动工程后访问 http://localhost:9001/hystrix,将会看到如下界面:

    技术分享

  • 相关阅读:
    CentOS系统下的数据盘挂载
    在iOS微信浏览器中自动播放HTML5 audio(音乐)的2种正确方式
    C盘占用过满问题
    大量ECAgent报错
    微信电脑版不断崩溃
    java web 在tomcat没有正常输出
    文件解压缩失败
    在myeclipse安装beyond插件
    限时免费 GoodSync 10 同步工具【转】
    soapUI的bug切换版本解决
  • 原文地址:https://www.cnblogs.com/wangjing666/p/7049985.html
Copyright © 2011-2022 走看看