Spring Boot (13) druid监控
druid
druid是和tomcat jdbc一样优秀的连接池,出自阿里巴巴。除了连接池,druid哈hi有一个很实用的监控功能。
pom.xml
添加了以下依赖后,会自动用druid连接池替代默认的tomcat jdbc连接池
<!--druid监控 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.0</version>
</dependency>
参数配置
在application.yml中配置spring.datasource.druid作为前缀的参数,会注入到druid连接池中。默认有的监控没有开启,现在全部配置开启
spring:
datasource:
#druid
druid:
#spring监控,可以用,监控多个内容 *匹配等
aop-patterns: com.david.controller.HelloController
stat-view-servlet:
#监控页面账号
login-username: admin
#监控页面密码
login-password: 1234
sql监控
启动项目:访问localhost:8088/druid/index.html
输入账号密码登陆 上面配置的
运行一个监控的程序,执行了controller包中的方法后,才能看到监控数据。
sql监控

其他监控
spring监控:和sql监控类似,我配置的是监控的HelloController,所以显示的是控制层执行的时间分布
数据源:显示当前连接池的参数配置,页面右上角有中英文切换,可以对照着查看说明
sql防火墙:防御sql攻击,拦截sql请求
Spring Boot (13) druid监控的更多相关文章
- Spring Boot配置druid监控页功能
1.导入坐标 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http ...
- spring boot(11)-druid监控
druid druid是和tomcat jdbc一样优秀的连接池,出自阿里巴巴.关于druid连接池参数,参考 https://github.com/alibaba/druid/wiki/DruidD ...
- spring boot 开启Druid监控功能
1.配置yml spring: datasource: # 数据源基本配置 username: song password: 123456 driver-class-name: com.mysql.j ...
- Spring Boot开启Druid数据库监控功能
Druid是一个关系型数据库连接池,它是阿里巴巴的一个开源项目.Druid支持所有JDBC兼容的数据库,包括Oracle.MySQL.Derby.PostgreSQL.SQL Server.H2等.D ...
- Spring Boot [使用 Druid 数据库连接池]
导读 最近一段时间比较忙,以至于很久没有更新Spring Boot系列文章,恰好最近用到Druid, 就将Spring Boot 使用 Druid作为数据源做一个简单的介绍. Druid介绍: Dru ...
- Spring Boot使用Druid连接池基本配置
以下为Spring Boot配置Druid 一.pom.xml配置 <dependency> <groupId>com.alibaba</groupId> < ...
- Spring Boot下Druid连接池+mybatis
目前Spring Boot中默认支持的连接池有dbcp,dbcp2, hikari三种连接池. 引言: 在Spring Boot下默认提供了若干种可用的连接池,Druid来自于阿里系的一个开源连 ...
- Spring Boot + MyBatis + Druid + Redis + Thymeleaf 整合小结
Spring Boot + MyBatis + Druid + Redis + Thymeleaf 整合小结 这两天闲着没事想利用**Spring Boot**加上阿里的开源数据连接池**Druid* ...
- (16)Spring Boot使用Druid(编程注入)【从零开始学Spring Boot】
在上一节使用是配置文件的方式进行使用druid,这里在扩散下使用编程式进行使用Druid,在上一节我们新建了一个类:DruidConfiguration我在这个类进行编码: package com.k ...
随机推荐
- 基础:Post和Get区别
1.get是从服务器上获取数据,post是向服务器传送数据.2.在客户端, get方式在通过URL提交数据,数据在URL中可以看到:post方式,数据放置在HTML HEADER内提交3.对于get方 ...
- Laravel-Action 对代码的改造
前言 以往写过俩篇文章[积德篇] 如何少写PHP "烂"代码 https://segmentfault.com/a/11...举枪消灭"烂代码"的实战案例 ht ...
- Python面向对象----继承, 重载
1. 面向对象三大特性之继承. 继承的便捷是子类可以直接调用父类里面的方法和属性.(在强类型语言里面是只能调用公有成员), 不用重复的造轮子. 减少程序猿的负担.实现多态等上层结构 2. 父类代码 3 ...
- 腾讯云:ubuntu搭建 FTP 文件服务
搭建 FTP 文件服务 安装并启动 FTP 服务 任务时间:5min ~ 10min 安装 VSFTPD 使用 apt-get 安装 vsftpd: sudo apt-get install vsft ...
- 『REM』手机屏幕适配
function adapt(designWidth, rem2px){ var d = window.document.createElement('div'); d.style.width = ' ...
- 【[Offer收割]编程练习赛12 D】 寻找最大值
[题目链接]:http://hihocoder.com/problemset/problem/1496 [题意] [题解] 先把这n个数排个序吧. 这样相邻的数字就在一起了; 这样a[i]&a ...
- JavaSE 学习笔记之String字符串(十四)
API:(Application Programming Interface,应用程序编程接口)是一些预先定义的函数,目的是提供应用程序与开发人员基于某软件或硬件的以访问一组例程的能力,而又无需访问源 ...
- ZOJ 3233 Lucky Number
Lucky Number Time Limit: 5000ms Memory Limit: 32768KB This problem will be judged on ZJU. Original I ...
- mybatis源码阅读-初始化六个工具(六)
六个基本工具图集 图片来源:https://my.oschina.net/zudajun/blog/668596 ObjectFactory 类图 接口定义 public interface Obje ...
- VNC Server Installation on CentOS 6.5
In my case I have a fresh installed CentOS6.5 Server on which I will be installing the VNC-server so ...