https://github.com/hwywl/link-track-spring-boot-starter
链路跟踪,统计每个方法的耗时异常
https://github.com/hwywl/link-track-spring-boot-starter
linked-data track
Last synced: 4 months ago
JSON representation
链路跟踪,统计每个方法的耗时异常
- Host: GitHub
- URL: https://github.com/hwywl/link-track-spring-boot-starter
- Owner: HWYWL
- License: apache-2.0
- Created: 2021-05-08T08:32:34.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-12T10:27:09.000Z (about 4 years ago)
- Last Synced: 2025-01-08T06:35:28.763Z (5 months ago)
- Topics: linked-data, track
- Language: SCSS
- Homepage:
- Size: 1.52 MB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# link-track-spring-boot-starter
链路跟踪,最终项目每个方法的耗时,便于优化。[](https://github.com/HWYWL) [](https://search.maven.org/artifact/com.github.hwywl/link-track-spring-boot-starter/1.2.0-RELEASE/jar) [](https://github.com/HWYWL)
### 安装
**maven**
提供了两种前端模板引擎:thymeleaf、freemarker,默认为:thymeleaf
以下使用Spring boot项目举例。如果项目使用thymeleaf作为模板引擎,需要引入如下:
```com.github.hwywl
link-track-spring-boot-starter
1.2.0-RELEASEorg.springframework.boot
spring-boot-starter-thymeleaf```
如果项目使用freemarker作为模板引擎,需要引入如下:
```com.github.hwywl
link-track-spring-boot-starter
1.2.0-RELEASEorg.springframework.boot
spring-boot-starter-freemarker```
**如果Spring Boot是2.4.x以下版本请使用1.1.0-RELEASE**
```com.github.hwywl
link-track-spring-boot-starter
1.1.0-RELEASEorg.springframework.boot
spring-boot-starter-thymeleaf & freemarker```
**application.properties**配置:
```
# 拦截扫描的位置,一般和项目启动类同一个包名下,这样可以扫描整个项目
link-track.log.conf.pointcut=execution(* com.jinkejoy.chat.aliyunchat..*(..))}# 模板引擎,和引入的依赖相关,写错会404无法访问,默认为:thymeleaf
link-track.log.conf.show-template=thymeleaf# 接口耗时的阈值,默认为500ms
link-track.log.conf.time-threshold=800
```需要注意,推荐使用**thymeleaf**引擎,**freemarker**引擎的一些样式比较丑,不过功能都是一样的。
## 使用
引入依赖后自带了页面,不需要单独部署,直接浏览器输入:**http://ip:端口/linkTrack** 即可访问。
默认打开的页面是没有任何数据了,只有项目的接口访问了才会被记录。### 主业
[](https://imgtu.com/i/gwmp7D)### 链路
[](https://imgtu.com/i/gwmk9A)### 注解**@WebLog**
注解在请求接口上,即可拦截,方便调试程序
## 版本更新
### 1.2.0-RELEASE 版本更新
1. 兼容页面支持Spring Boot 2.4.x版本### 1.1.0-RELEASE 版本更新
1. 数据生成时间显示
2. 增加每日访问总量统计
3. 增加日志打印注解**@WebLog**### 1.0.1-RELEASE 版本更新
1. 增加链路跟踪显示
2. 增加接口统计
3. 增加响应时间统计