最火springcloud教程第十二篇断路器开关电源扁电缆肉丸机乐器配件弹簧夹头Frc
2023-11-24 11:39:58 闽一机械网
spr空调控制ingcloud教程|第十二篇:断路器监控(hystrix dashboard)
作者:方志朋
链接:
在我的第四篇文章断路器讲述了如何使用断路器,并简单的介绍了下hystrix dashboard组件,这篇文章更加详细的介绍hystrix dashboard。
一、hystrix dashboard简介
在微服务架构中为例保证程序的可用性,防止程序出错导致络阻塞,出现了断路器模型。断路器的状况反应了一个程序的可用性和健壮性,它是一个重要指标。hystrix dashboard是作为断路器状态的一个组件,提供了数据监控和友好的图形化界面。
二、准备工作
本文的的工程栗子,来源于第一篇文章的栗子,在它的基础上进行改造。
三、开始改造service-hi
在pom的工程文件引入相应的依赖:
ot
spring-boot-starter-actuator
oud
spring-cloud-starter-hystr通过首台(套)重大技术设备保险补偿政策ix-dashboard
oud
spring-cloud-s便于操作tarter-hystrix
其中,这三个依赖是必须的,缺一不可。
在程序的入口servicehiapplication类,加上@enablehystrix注解开启断路器,这个绕丝机是必须的,并且需要在程序中声明断路点hystrixcommand;加上@enablehystrixdashboard注解,开启hystrixdashboa选购压力试验机要留意些什么呢rd
@springbootapplication
@enableeurekaclient
@restcontroller
@enablehystrix
@enablehystrixdashboard
public class servicehiapplication {
public static void main(string[] args) {
n(ass, args);
}
@value("${rt}")
string port;
@requestmapping("/hi")
@hy美工刀strixcommand(fallbackmethod = "hierror")
public string home(@request同时param string name) {
return "hi "+name+",i am from port:" +port;
}
public string hierror(string name) {
return "hi,"+name+",sorry,error!";
}
}
运行程序: 依次开启eureka-server 和service-hi.
四、hystrix dashboard图形展示
打开http://localhost:8762/ream,可以看到一些具体的数据:
打开locahost:8762/hystrix 可以看见以下界面:
在界面依次输入:locahost:8762/ream 、2000 、miya
;点确定。
在另一个窗口输入: http://localhost:8762/hi?name=forezp
重新刷新ream页,你会看到良好的图形化界面:
源码下载:<起绒纱/p>脱流塔工作原理
我的新老师结尾怎么写
四川省表演分数线是多少分
烤鸭粉丝汤的做法