当前位置:网站首页>Monitor page deployment
Monitor page deployment
2022-07-30 03:32:00 【Leon_Jinhai_Sun】
In addition to downgrading and fusing the service, we can also monitor it in real time, just install the monitoring page, here we create a new project and import dependencies:
org.springframework.cloud spring-cloud-starter-netflix-hystrix-dashboard 2.2.10.RELEASE Then add the configuration file:
server:port: 8900hystrix:dashboard:# Add localhost to the whitelist, which is not allowed by defaultproxy-stream-allow-list: "localhost"Then create the main class, note that you need to add the @EnableHystrixDashboard annotation to open the management page:
@[email protected] class HystrixDashBoardApplication {public static void main(String[] args) {SpringApplication.run(HystrixDashBoardApplication.class, args);}}Start the Hystrix management page service, and then we need to add the Actuator dependency to the service to be monitored:
org.springframework.boot spring-boot-starter-actuator Actuator is the monitoring system of SpringBoot program, which can realize health check, record information, etc.Before using it, you need to introduce spring-boot-starter-actuator and do a simple configuration.
After adding this dependency, we can view the operation in IDEA:

Then configure Actuator in the configuration file to add exposure:
management:endpoints:web:exposure:include: '*'Then we open the management page just started, the address is: http://localhost:8900/hystrix/

Fill in the service to be monitored in the middle: for example, the borrowing service: http://localhost:8301/actuator/hystrix.stream, note that /actuator/hystrix.stream, then click Monitor Stream to enter the monitoring page:

You can see that it is in the Loading state now. This is because the statistics have not yet started. We now try to call our service several times:

You can see that after the call, information appears on the monitoring page:

You can see that the 5 visits are normal, so it is displayed in green. Next, let's try to close the book service, which will cause the service to be degraded or even broken, and then visit this service multiple times to seeSee how monitoring changes:

It can be seen that the error rate has soared to 100%, and errors have continued to occur for a period of time, and the circle in the center has also turned red, and we continue to visit:

Maintain continuous access in the event of a large number of errors, you can see that the service has been blown at this time, the Circuit has changed to the Open state, and the circle in the figure has also becomeLarger, it means the pressure is continuing to rise.
边栏推荐
猜你喜欢

开放地址法哈希实现——线性探测法

Open address method hash implementation - linear detection method

Are you still using the command line to read logs?Quickly use Kibana, visual log analysis YYDS

Testers, what else do you need to know besides testing?

WPF引入 ttf 图标文件使用记录

Nacos服务注册与发现

三年经验只会点点点(功能测试),辞职后你可能连工作都找不到了。

答对这3个面试问题,薪资直涨20K

状态空间表示

nSoftware.PowerShell.Server.2020
随机推荐
CDH/CDP 是什么?
中级-面试题目整理
Open address method hash implementation - linear detection method
如何有效进行回顾会议(上)?
sublime text 3 设置
Stimulsoft ReportsJS and DashboardsJS. 2022.3.3
联邦学习综述(二)——联邦学习的分类、框架及未来研究方向
软件测试面试题及答案解析,2022最强版
3.nodejs--modularization
MySQ死锁
最重要的传输层
【Node访问MongoDB数据库】
[3D检测系列-PointRCNN]复现PointRCNN代码,并实现PointRCNN3D目标检测可视化,包含预训练权重下载链接(从0开始以及各种报错的解决方法)
【JS】iframe 嵌入页面用法
NLP自然语言处理(一)
历经5面的阿里实习面经篇~
【SQL】按某个关联列用一张表的数据更新另一张表
Open address method hash implementation - secondary detection method
day10--在Linux上安装mysql
Drools(7):WorkBench