zoukankan      html  css  js  c++  java
  • mybatis-plus 性能分析插件

    1.MP的性能插件用于输出每条sql以及执行时间。

    ①导入插件

       @Bean
        @Profile({"dev","test"})//设置dev test环境开启,保证效率
        public PerformanceInterceptor performanceInterceptor(){
            PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
            performanceInterceptor.setMaxTime(1000);//sql最多执行时间
            performanceInterceptor.setFormat(true);//sql脚本格式化
            return performanceInterceptor;
        }

    注意:要在springboot中配置环境为dev或者test环境

    spring.profiles.active=dev

    ②测试:执行时间超过设置的时间就会报错。

    @Test
        public void selectLogicTest(){
            userMapper.selectById(1366738104190881793L);//SELECT id,name,age,email,create_time,update_time,version,deleted FROM user WHERE id=? AND deleted=0
        }

     

    所有博客均为自己学习的笔记。如有错误敬请理解。
  • 相关阅读:
    Markdown常用语法
    课程及资源链接
    cpa-会计
    高管具备的能力
    JDK并发包-copy
    Guava工具类学习-copy
    java开发注解大全-copy
    Codeforces Round #703 (Div. 2)
    [ABC200E] Minflip Summation
    Codeforces Round #720 (Div. 2)
  • 原文地址:https://www.cnblogs.com/tangtang-benben/p/14508608.html
Copyright © 2011-2022 走看看