当前位置: 首页 > news >正文

西安网络公司做网站外贸网站推广与优化

西安网络公司做网站,外贸网站推广与优化,新疆建设兵团招聘网站,交友网站如何做一、Actuator简介 1、监控组件作用 在生产环境中,需要实时或定期监控服务的可用性。Spring Boot的actuator(健康监控)功能提供了很多监控所需的接口,可以对应用系统进行配置查看、相关功能统计等。 2、监控分类 Actuator 提供…

一、Actuator简介

1、监控组件作用

在生产环境中,需要实时或定期监控服务的可用性。Spring Boot的actuator(健康监控)功能提供了很多监控所需的接口,可以对应用系统进行配置查看、相关功能统计等。

2、监控分类

Actuator 提供Rest接口,展示监控信息,接口分为三大类:

  • 应用配置类:获取应用程序中加载的应用配置、环境变量、自动化配置报告等与SpringBoot应用相关的配置类信息。
  • 度量指标类:获取应用程序运行过程中用于监控的度量指标,比如:内存信息、线程池信息、HTTP请求统计等。
  • 操作控制类:提供了对应用的关闭等操作类功能。

二、SpringBoot2整合

1、核心依赖Jar包

<!-- 监控依赖 -->
<dependency><groupid>org.springframework.boot</groupid><artifactid>spring-boot-starter-actuator</artifactid>
</dependency>

2、Yml配置文件

# 端口
server:port: 8016
spring:application:# 应用名称name: node16-boot-actuator
management:endpoints:web:exposure:# 打开所有的监控点include: "*"# 自定义监控路径 monitor# 默认值:http://localhost:8016/actuator/*# 配置后:http://localhost:8016/monitor/*base-path: /monitorendpoint:health:show-details: alwaysshutdown:# 通过指定接口关闭 SpringBootenabled: true# 可以自定义端口# server:#   port: 8089# 描述项目基础信息
info:app:name: node16-boot-actuatorport: 8016version: 1.0.0author: cicada

三、监控接口详解

1、Info接口

Yml文件中配置的项目基础信息

路径:http://localhost:8016/monitor/info 输出

{"app": {"name": "node16-boot-actuator","port": 8016,"version": "1.0.0","author": "cicada"}
}

2、Health接口

health 主要用来检查应用的运行状态

路径:http://localhost:8016/monitor/health 输出:

{"status": "UP","details": {"diskSpace": {"status": "UP","details": {"total": 185496236032,"free": 140944084992,"threshold": 10485760}}}
}

3、Beans接口

展示了 bean 的类型、单例多例、别名、类的全路径、依赖Jar等内容。

路径:http://localhost:8016/monitor/beans 输出

{"contexts": {"node16-boot-actuator": {"beans": {"endpointCachingOperationInvokerAdvisor": {"aliases": [],"scope": "singleton","type": "org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor","resource": "class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/EndpointAutoConfiguration.class]","dependencies": ["environment"]}}}
}

4、Conditions接口

查看配置在什么条件下有效,或者自动配置为什么无效。

路径:http://localhost:8016/monitor/conditions 输出

{"contexts": {"node16-boot-actuator": {"positiveMatches": {"AuditAutoConfiguration#auditListener": [{"condition": "OnBeanCondition","message": "@ConditionalOnMissingBean"}],}
}

5、HeapDump接口

自动生成Jvm的堆转储文件HeapDump,可以使用监控工具 VisualVM 打开此文件查看内存快照。

路径:http://localhost:8016/monitor/heapdump

6、Mappings接口

描述 URI 路径和控制器的映射关系

路径:http://localhost:8016/monitor/mappings 输出

{"contexts": {"node16-boot-actuator": {"mappings": {"dispatcherServlets": {"dispatcherServlet": [ {"handler": "Actuator web endpoint 'auditevents'","predicate": "{GET /monitor/auditevents || application/json]}","details": {"handlerMethod": {"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.Operat"name": "handle","descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"},"requestMappingConditions": {"consumes": [],"headers": [],"methods": ["GET"],"params": [],"patterns": ["/monitor/auditevents"],"produces": [{"mediaType": "application/vnd.spring-boot.actuator.v2+json","negated": false}, {"mediaType": "application/json","negated": false}]}}}}}
}

7、ThreadDump接口

展示线程名、线程ID、是否等待锁、线程的状态、线程锁等相关信息。

路径:http://localhost:8016/monitor/threaddump 输出

{"threads": [{"threadName": "DestroyJavaVM","threadId": 34,"blockedTime": -1,"blockedCount": 0,"waitedTime": -1,"waitedCount": 0,"lockName": null,"lockOwnerId": -1,"lockOwnerName": null,"inNative": false,"suspended": false,"threadState": "RUNNABLE","stackTrace": [],"lockedMonitors": [],"lockedSynchronizers": [],"lockInfo": null}]
}

8、ShutDown接口

优雅关闭 Spring Boot 应用,默认只支持POST请求。

路径:http://localhost:8016/monitor/shutdown

http://www.zhongyajixie.com/news/61946.html

相关文章:

  • 台州自助建站公司百度指数数据
  • 网站5建设需要学什么百度关键词排名工具
  • 威海好的网站建设公司哪家好电商营销策划方案
  • 中央两学一做网站直通车优化推广
  • 太原便宜做网站的公司哪家好百度快照下载
  • 做网站编辑累吗杭州网站推广与优化
  • 腾讯云怎么做网站百度新闻app
  • 海南建设培训网站推广平台收费标准
  • wordpress 窗口大小seo是做什么的
  • 二次网站开发建立网站的流程
  • 网站等级保护如何做西安网站搭建
  • 邢台市人事考试网郑州网站seo推广
  • 目前玩的人最多网游排行长春seo关键词排名
  • 旅游网站建设系统开鲁网站seo转接
  • 建筑公司做网站买空间多大合适常见的网络营销平台有哪些
  • 学校网站制作模板专业网站优化公司
  • 企业宣传网站建设模板深圳seo优化方案
  • 青岛高端网站制作磁力链 ciliba
  • 兰州做家教去哪个网站比较好排名优化推广
  • 专门做环保设备的网站seo就是搜索引擎广告
  • 网页开发公司网站分析网站
  • 如何自己创建一个网页南宁seo外包靠谱吗
  • 阿里云 iis 多个网站创建自己的网页
  • 怎么在网站首页做飘窗搜索引擎调词工具
  • 自己做pc网站建设百度引流推广哪家好
  • wordpress判断当前url二级域名和一级域名优化难度
  • 做网站的意义是什么厦门seo顾问
  • 网站制作 网站建设百度指数怎么看
  • 免费收录网站提交seo排名软件价格
  • 淘宝官方网站登录页面免费海报模板网站