springboot 集成java simon 2018-09-25 Spring spring, 性能监控 评论项目情况springboot (无xml配置,都是java代码的配置)gradle集成simon添加依赖123compile group: 'org.javasimon', name: 'javasimon-spring', version: '4.1.4'compile group: 'org.javasimon', name: 'javasimon-console-embed', version: '4.1.4'compile group: 'org.javasimon', name: 'javasimon-jdbc4', version: '3.5.2'添加配置文件1234567891011121314151617181920212223242526/** * @author xiaobiao * @version 2018/9/21 */@Configurationpublic class JavaSimonConfig { // 定义AOP @Bean(name = "monitoringAdvisor") public DefaultPointcutAdvisor monitoringAdvisor() { DefaultPointcutAdvisor monitoringAdvisor = new DefaultPointcutAdvisor(); monitoringAdvisor.setAdvice(new MonitoringInterceptor()); monitoringAdvisor.setPointcut(new MonitoredMeasuringPointcut()); return monitoringAdvisor; } // 定义Servlet URL Mapping @Bean public ServletRegistrationBean dispatcherRegistration() { ServletRegistrationBean registration = new ServletRegistrationBean(new SimonConsoleServlet()); registration.addInitParameter("url-prefix", "/javasimon"); registration.addUrlMappings("/javasimon/*"); return registration; }}