mirror of
https://gitee.com/huoyo/ko-time.git
synced 2025-12-06 08:48:30 +08:00
koTime
介绍
koTime是一个springboot项目性能分析工具,通过追踪方法调用链路以及对应的运行时长快速定位性能瓶颈:
优点:
- 无缝集成springboot,使用简单
- 通过简单配置集成,与业务逻辑无耦合
缺点:
- 目前仅适用于单机版,不支持分布式和集群
安装教程
- 引入依赖 或者 下载发行版本
<dependency>
<groupId>cn.langpy</groupId>
<artifactId>koTime</artifactId>
<version>1.0</version>
</dependency>
- 配置信息
在application.yml中配置
spring.profiles.active=koTime
使用说明
- 新建一个类,实现ComputeTimeHandlerInterface,并在 @Pointcut 写入 需要监测的范围
@Component
@Aspect
public class RunTimeHandler implements ComputeTimeHandlerInterface {
@Override
@Pointcut("execution(* com.huoyo..*.*(..))")
public void prog() {
}
}
- 启动项目访问
/koTime路径即可
比如:http://localhost:8080/koTime
如果项目自定义的contextpath,访问如http://localhost:8080/xxx服务/koTime
版本说明
1.接口列表总览
在列表中会显示该接口的运行耗时,如果为绿色则无需优化,如果为红色,需要详细查看问题所在
2.调用详情
点开接口时,会显示该接口的调用链路以及运行时长
版本说明
V1.0:-
问题说明
- 本项目中使用了aspectjweaver依赖,如果引入的项目中没有该依赖,自行引入
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>xxx</version>
</dependency>
Languages
Java
58.6%
HTML
23.8%
CSS
12.5%
JavaScript
5.1%


