1、接口耗时查询:trace 命令
trace 命令能主动搜索 class-pattern/method-pattern 对应的方法调用路径,渲染和统计整个调用链路上的所有性能开销和追踪调用链路。
1.1 准备测试应用
新建一个 SpringBoot 应用,写一段耗时久的代码:
@GetMapping("/methodTrace")
public String methodTrace() throws InterruptedException {
log.info("methodTrace start...");
Thread.sleep(1000);
this.methodTrace1();
this.methodTrace2();
log.info("methodTrace end...");
return "success";
}
private void methodTrace1() {
log.info("methodTrace1 start...");
}
private void methodTrace2() throws InterruptedException {
log.info("methodTrace2 start...");
Thread.sleep(2000);
this.methodTrace2_1();
this.methodTrace2_2(

最低0.47元/天 解锁文章
4222

被折叠的 条评论
为什么被折叠?



