(傲娇的白狐)Mybatis-plus性能分析插件 监控插件


Mybatis-plus性能分析插件 监控插件

用处:

可以查看sql运行情况,限定时间 超出会报异常。可以以此进行优化

在 yml文件栏 是指开发环境

# 性能分析插件配置
spring.profiles.active=dev

使用:

配置环境: 就行了 可以直接运行来查看

// 性能分析
@Bean
@Profile({"dev","test"}) // 设置 dev test 环境开启 保证我们的效率
public PerformanceInterceptor performanceInterceptor(){

PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();

performanceInterceptor.setMaxTime(100); // 设置sql最大执行时间 ,超过了不执行
performanceInterceptor.setFormat(true);//
return performanceInterceptor;
}

 

测试:

performanceInterceptor.setMaxTime(20);设为20

 

 超出设置

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM