druid 项目的sql执行速度效率监控的配置

在jdbc.properties中配置连接参数

#druid dataSource pool
druid.mysql.driver = com.mysql.jdbc.Driver
druid.initialSize = 3
druid.maxActive = 20
druid.maxIdle=5
druid.minIdle = 2
druid.maxWait = 60000
druid.removeAbandoned = true
druid.removeAbandonedTimeout = 180
druid.timeBetweenEvictionRunsMillis = 60000
druid.minEvictableIdleTimeMillis = 300000
druid.validationQuery = SELECT 1 FROM DUAL
druid.testWhileIdle = false
druid.testOnBorrow = false
druid.testOnReturn = false
druid.poolPreparedStatements = true
druid.maxPoolPreparedStatementPerConnectionSize = 20
filters =stat
 

#è¿æ¥è®¾ç½®
case.jdbc.url=jdbc:mysql://127.0.0.1:3306/cuiji?useUnicode\=true&characterEncoding\=utf-8&zeroDateTimeBehavior\=convertToNull
case.jdbc.username=root
case.jdbc.password=root



在web.xml中配置druid插件的配置




DruidStatView
com.alibaba.druid.support.http.StatViewServlet


DruidStatView
/druid/*


druidWebStatFilter
com.alibaba.druid.support.http.WebStatFilter

exclusions
/public/*,*.js,*.css,/druid*,*.jsp,*.swf


principalSessionName
sessionInfo


profileEnable
true



druidWebStatFilter
/*




在web端查看慢sql执行速度:



druid 项目的sql执行速度效率监控的配置_第1张图片


druid 项目的sql执行速度效率监控的配置_第2张图片

你可能感兴趣的:(druid)