mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
support monitor
This commit is contained in:
@@ -19,12 +19,22 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.stat.JdbcSqlStatValue;
|
||||
import com.alibaba.druid.support.monitor.MField;
|
||||
import com.alibaba.druid.support.monitor.dao.MTable;
|
||||
|
||||
@MTable(name="druid_datasource")
|
||||
public class DruidDataSourceStatValue {
|
||||
|
||||
@MField
|
||||
protected String name;
|
||||
|
||||
@MField
|
||||
protected String dbType;
|
||||
|
||||
@MField
|
||||
protected String driverClassName;
|
||||
|
||||
@MField
|
||||
protected String url;
|
||||
protected String userName;
|
||||
protected List<String> filterClassNames;
|
||||
@@ -45,40 +55,80 @@ public class DruidDataSourceStatValue {
|
||||
protected boolean defaultReadOnly;
|
||||
protected Integer defaultTransactionIsolation;
|
||||
|
||||
@MField
|
||||
protected int activeCount;
|
||||
|
||||
@MField
|
||||
protected int activePeak;
|
||||
|
||||
@MField
|
||||
protected long activePeakTime;
|
||||
|
||||
@MField
|
||||
protected int poolingCount;
|
||||
|
||||
@MField
|
||||
protected int poolingPeak;
|
||||
|
||||
@MField
|
||||
protected long poolingPeakTime;
|
||||
|
||||
@MField
|
||||
protected long connectCount;
|
||||
|
||||
@MField
|
||||
protected long closeCount;
|
||||
|
||||
@MField
|
||||
protected long waitThreadCount;
|
||||
|
||||
@MField
|
||||
protected long notEmptyWaitCount;
|
||||
|
||||
@MField
|
||||
protected long notEmptyWaitNanos;
|
||||
|
||||
@MField
|
||||
protected long logicConnectErrorCount;
|
||||
|
||||
@MField
|
||||
protected long physicalConnectCount;
|
||||
|
||||
@MField
|
||||
protected long physicalCloseCount;
|
||||
|
||||
@MField
|
||||
protected long physicalConnectErrorCount;
|
||||
|
||||
@MField
|
||||
protected long executeCount;
|
||||
@MField
|
||||
protected long errorCount;
|
||||
@MField
|
||||
protected long commitCount;
|
||||
@MField
|
||||
protected long rollbackCount;
|
||||
@MField
|
||||
protected long pstmtCacheHitCount;
|
||||
@MField
|
||||
protected long pstmtCacheMissCount;
|
||||
@MField
|
||||
protected long startTransactionCount;
|
||||
|
||||
protected long[] transactionHistogram;
|
||||
protected long[] connectionHoldTimeHistogram;
|
||||
|
||||
@MField
|
||||
protected long clobOpenCount;
|
||||
|
||||
@MField
|
||||
protected long blobOpenCount;
|
||||
|
||||
|
||||
protected long sqlSkipCount;
|
||||
|
||||
protected List<JdbcSqlStatValue> sqlList;
|
||||
|
||||
|
||||
public Date getPoolingPeakTime() {
|
||||
if (poolingPeakTime <= 0) {
|
||||
return null;
|
||||
@@ -482,6 +532,5 @@ public class DruidDataSourceStatValue {
|
||||
public void setPoolingPeakTime(long poolingPeakTime) {
|
||||
this.poolingPeakTime = poolingPeakTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -22,9 +22,11 @@ import java.util.Map;
|
||||
import javax.management.JMException;
|
||||
|
||||
import com.alibaba.druid.support.monitor.MField;
|
||||
import com.alibaba.druid.util.Utils;
|
||||
import com.alibaba.druid.support.monitor.dao.MTable;
|
||||
import com.alibaba.druid.util.JMXUtils;
|
||||
import com.alibaba.druid.util.Utils;
|
||||
|
||||
@MTable(name = "druid_sql")
|
||||
public class JdbcSqlStatValue {
|
||||
|
||||
protected long id;
|
||||
@@ -37,31 +39,31 @@ public class JdbcSqlStatValue {
|
||||
@MField
|
||||
protected String dataSource;
|
||||
|
||||
@MField
|
||||
@MField(name = "lastStartTime")
|
||||
protected long executeLastStartTime;
|
||||
|
||||
@MField
|
||||
@MField(name = "batchTotal")
|
||||
protected long executeBatchSizeTotal;
|
||||
|
||||
@MField
|
||||
@MField(name = "batchToMax")
|
||||
protected int executeBatchSizeMax;
|
||||
|
||||
@MField
|
||||
@MField(name = "execSuccessCount")
|
||||
protected long executeSuccessCount;
|
||||
|
||||
@MField
|
||||
@MField(name = "execNanoTotal")
|
||||
protected long executeSpanNanoTotal;
|
||||
|
||||
@MField
|
||||
@MField(name = "execNanoMax")
|
||||
protected long executeSpanNanoMax;
|
||||
|
||||
@MField
|
||||
@MField(name = "running")
|
||||
protected int runningCount;
|
||||
|
||||
@MField
|
||||
protected int concurrentMax;
|
||||
|
||||
@MField
|
||||
@MField(name = "running")
|
||||
protected long resultSetHoldTimeNano;
|
||||
|
||||
@MField
|
||||
@@ -76,24 +78,24 @@ public class JdbcSqlStatValue {
|
||||
@MField
|
||||
protected String dbType;
|
||||
|
||||
@MField
|
||||
@MField(name = "execNanoMaxOccurTime")
|
||||
protected long executeNanoSpanMaxOccurTime;
|
||||
|
||||
@MField
|
||||
@MField(name = "errorCount")
|
||||
protected long executeErrorCount;
|
||||
|
||||
protected Throwable executeErrorLast;
|
||||
|
||||
@MField
|
||||
@MField(name = "errorLastMsg")
|
||||
protected String executeErrorLastMessage;
|
||||
|
||||
@MField
|
||||
@MField(name = "errorLastClass")
|
||||
protected String executeErrorLastClass;
|
||||
|
||||
@MField
|
||||
@MField(name = "errorLastStackTrace")
|
||||
protected String executeErrorLastStackTrace;
|
||||
|
||||
@MField
|
||||
@MField(name = "errorLastTime")
|
||||
protected long executeErrorLastTime;
|
||||
|
||||
@MField
|
||||
@@ -108,7 +110,7 @@ public class JdbcSqlStatValue {
|
||||
@MField
|
||||
protected long fetchRowCountMax;
|
||||
|
||||
@MField
|
||||
@MField(name = "inTxnCount")
|
||||
protected long inTransactionCount;
|
||||
|
||||
@MField
|
||||
@@ -452,7 +454,7 @@ public class JdbcSqlStatValue {
|
||||
|
||||
public void setExecuteErrorLast(Throwable executeErrorLast) {
|
||||
this.executeErrorLast = executeErrorLast;
|
||||
|
||||
|
||||
if (executeErrorLast != null) {
|
||||
this.executeErrorLastMessage = executeErrorLast.getMessage();
|
||||
this.executeErrorLastClass = executeErrorLast.getClass().getName();
|
||||
|
||||
@@ -18,586 +18,671 @@ package com.alibaba.druid.support.http.stat;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.druid.support.monitor.MField;
|
||||
import com.alibaba.druid.support.monitor.dao.MTable;
|
||||
|
||||
@MTable(name = "druid_webapp")
|
||||
public class WebAppStatValue {
|
||||
|
||||
@MField
|
||||
String contextPath;
|
||||
|
||||
@MField
|
||||
int runningCount;
|
||||
|
||||
@MField
|
||||
int concurrentMax;
|
||||
|
||||
@MField
|
||||
long requestCount;
|
||||
|
||||
@MField
|
||||
long sessionCount;
|
||||
|
||||
@MField
|
||||
long jdbcFetchRowCount;
|
||||
|
||||
@MField
|
||||
long jdbcUpdateCount;
|
||||
|
||||
@MField
|
||||
long jdbcExecuteCount;
|
||||
|
||||
@MField
|
||||
long jdbcExecuteTimeNano;
|
||||
|
||||
@MField
|
||||
long jdbcCommitCount;
|
||||
|
||||
@MField
|
||||
long jdbcRollbackCount;
|
||||
|
||||
|
||||
@MField
|
||||
long osMacOSXCount;
|
||||
|
||||
@MField
|
||||
long osWindowsCount;
|
||||
|
||||
@MField
|
||||
long osLinuxCount;
|
||||
|
||||
@MField
|
||||
long osSymbianCount;
|
||||
|
||||
@MField
|
||||
long osFreeBSDCount;
|
||||
|
||||
@MField
|
||||
long osOpenBSDCount;
|
||||
|
||||
@MField
|
||||
long osAndroidCount;
|
||||
|
||||
|
||||
@MField
|
||||
long osWindows98Count;
|
||||
|
||||
@MField
|
||||
long osWindowsXPCount;
|
||||
|
||||
@MField
|
||||
long osWindows2000Count;
|
||||
|
||||
@MField
|
||||
long osWindowsVistaCount;
|
||||
|
||||
@MField
|
||||
long osWindows7Count;
|
||||
|
||||
@MField
|
||||
long osWindows8Count;
|
||||
|
||||
@MField
|
||||
long osAndroid15Count;
|
||||
@MField
|
||||
long osAndroid16Count;
|
||||
@MField
|
||||
long osAndroid20Count;
|
||||
@MField
|
||||
long osAndroid21Count;
|
||||
@MField
|
||||
long osAndroid22Count;
|
||||
@MField
|
||||
long osAndroid23Count;
|
||||
@MField
|
||||
long osAndroid30Count;
|
||||
@MField
|
||||
long osAndroid31Count;
|
||||
@MField
|
||||
long osAndroid32Count;
|
||||
@MField
|
||||
long osAndroid40Count;
|
||||
@MField
|
||||
long osAndroid41Count;
|
||||
@MField
|
||||
long osAndroid42Count;
|
||||
@MField
|
||||
long osAndroid43Count;
|
||||
|
||||
|
||||
@MField
|
||||
long osLinuxUbuntuCount;
|
||||
|
||||
|
||||
@MField
|
||||
long browserIECount;
|
||||
@MField
|
||||
long browserFirefoxCount;
|
||||
@MField
|
||||
long browserChromeCount;
|
||||
@MField
|
||||
long browserSafariCount;
|
||||
@MField
|
||||
long browserOperaCount;
|
||||
|
||||
@MField
|
||||
long browserIE5Count;
|
||||
@MField
|
||||
long browserIE6Count;
|
||||
@MField
|
||||
long browserIE7Count;
|
||||
@MField
|
||||
long browserIE8Count;
|
||||
@MField
|
||||
long browserIE9Count;
|
||||
@MField
|
||||
long browserIE10Count;
|
||||
|
||||
|
||||
@MField
|
||||
long browser360SECount;
|
||||
@MField
|
||||
long deviceAndroidCount;
|
||||
@MField
|
||||
long deviceIpadCount;
|
||||
@MField
|
||||
long deviceIphoneCount;
|
||||
@MField
|
||||
long deviceWindowsPhoneCount;
|
||||
|
||||
@MField
|
||||
long botCount;
|
||||
@MField
|
||||
long botBaiduCount;
|
||||
@MField
|
||||
long botYoudaoCount;
|
||||
@MField
|
||||
long botGoogleCount;
|
||||
@MField
|
||||
long botMsnCount;
|
||||
@MField
|
||||
long botBingCount;
|
||||
@MField
|
||||
long botSosoCount;
|
||||
@MField
|
||||
long botSogouCount;
|
||||
@MField
|
||||
long botYahooCount;
|
||||
|
||||
|
||||
public String getContextPath() {
|
||||
return contextPath;
|
||||
}
|
||||
|
||||
|
||||
public void setContextPath(String contextPath) {
|
||||
this.contextPath = contextPath;
|
||||
}
|
||||
|
||||
|
||||
public int getRunningCount() {
|
||||
return runningCount;
|
||||
}
|
||||
|
||||
|
||||
public void setRunningCount(int runningCount) {
|
||||
this.runningCount = runningCount;
|
||||
}
|
||||
|
||||
|
||||
public int getConcurrentMax() {
|
||||
return concurrentMax;
|
||||
}
|
||||
|
||||
|
||||
public void setConcurrentMax(int concurrentMax) {
|
||||
this.concurrentMax = concurrentMax;
|
||||
}
|
||||
|
||||
|
||||
public long getRequestCount() {
|
||||
return requestCount;
|
||||
}
|
||||
|
||||
|
||||
public void setRequestCount(long requestCount) {
|
||||
this.requestCount = requestCount;
|
||||
}
|
||||
|
||||
|
||||
public long getSessionCount() {
|
||||
return sessionCount;
|
||||
}
|
||||
|
||||
|
||||
public void setSessionCount(long sessionCount) {
|
||||
this.sessionCount = sessionCount;
|
||||
}
|
||||
|
||||
|
||||
public long getJdbcFetchRowCount() {
|
||||
return jdbcFetchRowCount;
|
||||
}
|
||||
|
||||
|
||||
public void setJdbcFetchRowCount(long jdbcFetchRowCount) {
|
||||
this.jdbcFetchRowCount = jdbcFetchRowCount;
|
||||
}
|
||||
|
||||
|
||||
public long getJdbcUpdateCount() {
|
||||
return jdbcUpdateCount;
|
||||
}
|
||||
|
||||
|
||||
public void setJdbcUpdateCount(long jdbcUpdateCount) {
|
||||
this.jdbcUpdateCount = jdbcUpdateCount;
|
||||
}
|
||||
|
||||
|
||||
public long getJdbcExecuteCount() {
|
||||
return jdbcExecuteCount;
|
||||
}
|
||||
|
||||
|
||||
public void setJdbcExecuteCount(long jdbcExecuteCount) {
|
||||
this.jdbcExecuteCount = jdbcExecuteCount;
|
||||
}
|
||||
|
||||
|
||||
public long getJdbcExecuteTimeNano() {
|
||||
return jdbcExecuteTimeNano;
|
||||
}
|
||||
|
||||
|
||||
public void setJdbcExecuteTimeNano(long jdbcExecuteTimeNano) {
|
||||
this.jdbcExecuteTimeNano = jdbcExecuteTimeNano;
|
||||
}
|
||||
|
||||
|
||||
public long getJdbcCommitCount() {
|
||||
return jdbcCommitCount;
|
||||
}
|
||||
|
||||
|
||||
public void setJdbcCommitCount(long jdbcCommitCount) {
|
||||
this.jdbcCommitCount = jdbcCommitCount;
|
||||
}
|
||||
|
||||
|
||||
public long getJdbcRollbackCount() {
|
||||
return jdbcRollbackCount;
|
||||
}
|
||||
|
||||
|
||||
public void setJdbcRollbackCount(long jdbcRollbackCount) {
|
||||
this.jdbcRollbackCount = jdbcRollbackCount;
|
||||
}
|
||||
|
||||
|
||||
public long getOsMacOSXCount() {
|
||||
return osMacOSXCount;
|
||||
}
|
||||
|
||||
|
||||
public void setOsMacOSXCount(long osMacOSXCount) {
|
||||
this.osMacOSXCount = osMacOSXCount;
|
||||
}
|
||||
|
||||
|
||||
public long getOsWindowsCount() {
|
||||
return osWindowsCount;
|
||||
}
|
||||
|
||||
|
||||
public void setOsWindowsCount(long osWindowsCount) {
|
||||
this.osWindowsCount = osWindowsCount;
|
||||
}
|
||||
|
||||
|
||||
public long getOsLinuxCount() {
|
||||
return osLinuxCount;
|
||||
}
|
||||
|
||||
|
||||
public void setOsLinuxCount(long osLinuxCount) {
|
||||
this.osLinuxCount = osLinuxCount;
|
||||
}
|
||||
|
||||
|
||||
public long getOsSymbianCount() {
|
||||
return osSymbianCount;
|
||||
}
|
||||
|
||||
|
||||
public void setOsSymbianCount(long osSymbianCount) {
|
||||
this.osSymbianCount = osSymbianCount;
|
||||
}
|
||||
|
||||
|
||||
public long getOsFreeBSDCount() {
|
||||
return osFreeBSDCount;
|
||||
}
|
||||
|
||||
|
||||
public void setOsFreeBSDCount(long osFreeBSDCount) {
|
||||
this.osFreeBSDCount = osFreeBSDCount;
|
||||
}
|
||||
|
||||
|
||||
public long getOsOpenBSDCount() {
|
||||
return osOpenBSDCount;
|
||||
}
|
||||
|
||||
|
||||
public void setOsOpenBSDCount(long osOpenBSDCount) {
|
||||
this.osOpenBSDCount = osOpenBSDCount;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroidCount() {
|
||||
return osAndroidCount;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroidCount(long osAndroidCount) {
|
||||
this.osAndroidCount = osAndroidCount;
|
||||
}
|
||||
|
||||
|
||||
public long getOsWindows98Count() {
|
||||
return osWindows98Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsWindows98Count(long osWindows98Count) {
|
||||
this.osWindows98Count = osWindows98Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsWindowsXPCount() {
|
||||
return osWindowsXPCount;
|
||||
}
|
||||
|
||||
|
||||
public void setOsWindowsXPCount(long osWindowsXPCount) {
|
||||
this.osWindowsXPCount = osWindowsXPCount;
|
||||
}
|
||||
|
||||
|
||||
public long getOsWindows2000Count() {
|
||||
return osWindows2000Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsWindows2000Count(long osWindows2000Count) {
|
||||
this.osWindows2000Count = osWindows2000Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsWindowsVistaCount() {
|
||||
return osWindowsVistaCount;
|
||||
}
|
||||
|
||||
|
||||
public void setOsWindowsVistaCount(long osWindowsVistaCount) {
|
||||
this.osWindowsVistaCount = osWindowsVistaCount;
|
||||
}
|
||||
|
||||
|
||||
public long getOsWindows7Count() {
|
||||
return osWindows7Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsWindows7Count(long osWindows7Count) {
|
||||
this.osWindows7Count = osWindows7Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsWindows8Count() {
|
||||
return osWindows8Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsWindows8Count(long osWindows8Count) {
|
||||
this.osWindows8Count = osWindows8Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid15Count() {
|
||||
return osAndroid15Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid15Count(long osAndroid15Count) {
|
||||
this.osAndroid15Count = osAndroid15Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid16Count() {
|
||||
return osAndroid16Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid16Count(long osAndroid16Count) {
|
||||
this.osAndroid16Count = osAndroid16Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid20Count() {
|
||||
return osAndroid20Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid20Count(long osAndroid20Count) {
|
||||
this.osAndroid20Count = osAndroid20Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid21Count() {
|
||||
return osAndroid21Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid21Count(long osAndroid21Count) {
|
||||
this.osAndroid21Count = osAndroid21Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid22Count() {
|
||||
return osAndroid22Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid22Count(long osAndroid22Count) {
|
||||
this.osAndroid22Count = osAndroid22Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid23Count() {
|
||||
return osAndroid23Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid23Count(long osAndroid23Count) {
|
||||
this.osAndroid23Count = osAndroid23Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid30Count() {
|
||||
return osAndroid30Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid30Count(long osAndroid30Count) {
|
||||
this.osAndroid30Count = osAndroid30Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid31Count() {
|
||||
return osAndroid31Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid31Count(long osAndroid31Count) {
|
||||
this.osAndroid31Count = osAndroid31Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid32Count() {
|
||||
return osAndroid32Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid32Count(long osAndroid32Count) {
|
||||
this.osAndroid32Count = osAndroid32Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid40Count() {
|
||||
return osAndroid40Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid40Count(long osAndroid40Count) {
|
||||
this.osAndroid40Count = osAndroid40Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid41Count() {
|
||||
return osAndroid41Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid41Count(long osAndroid41Count) {
|
||||
this.osAndroid41Count = osAndroid41Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid42Count() {
|
||||
return osAndroid42Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid42Count(long osAndroid42Count) {
|
||||
this.osAndroid42Count = osAndroid42Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsAndroid43Count() {
|
||||
return osAndroid43Count;
|
||||
}
|
||||
|
||||
|
||||
public void setOsAndroid43Count(long osAndroid43Count) {
|
||||
this.osAndroid43Count = osAndroid43Count;
|
||||
}
|
||||
|
||||
|
||||
public long getOsLinuxUbuntuCount() {
|
||||
return osLinuxUbuntuCount;
|
||||
}
|
||||
|
||||
|
||||
public void setOsLinuxUbuntuCount(long osLinuxUbuntuCount) {
|
||||
this.osLinuxUbuntuCount = osLinuxUbuntuCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserIECount() {
|
||||
return browserIECount;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserIECount(long browserIECount) {
|
||||
this.browserIECount = browserIECount;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserFirefoxCount() {
|
||||
return browserFirefoxCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserFirefoxCount(long browserFirefoxCount) {
|
||||
this.browserFirefoxCount = browserFirefoxCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserChromeCount() {
|
||||
return browserChromeCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserChromeCount(long browserChromeCount) {
|
||||
this.browserChromeCount = browserChromeCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserSafariCount() {
|
||||
return browserSafariCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserSafariCount(long browserSafariCount) {
|
||||
this.browserSafariCount = browserSafariCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserOperaCount() {
|
||||
return browserOperaCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserOperaCount(long browserOperaCount) {
|
||||
this.browserOperaCount = browserOperaCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserIE5Count() {
|
||||
return browserIE5Count;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserIE5Count(long browserIE5Count) {
|
||||
this.browserIE5Count = browserIE5Count;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserIE6Count() {
|
||||
return browserIE6Count;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserIE6Count(long browserIE6Count) {
|
||||
this.browserIE6Count = browserIE6Count;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserIE7Count() {
|
||||
return browserIE7Count;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserIE7Count(long browserIE7Count) {
|
||||
this.browserIE7Count = browserIE7Count;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserIE8Count() {
|
||||
return browserIE8Count;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserIE8Count(long browserIE8Count) {
|
||||
this.browserIE8Count = browserIE8Count;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserIE9Count() {
|
||||
return browserIE9Count;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserIE9Count(long browserIE9Count) {
|
||||
this.browserIE9Count = browserIE9Count;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowserIE10Count() {
|
||||
return browserIE10Count;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowserIE10Count(long browserIE10Count) {
|
||||
this.browserIE10Count = browserIE10Count;
|
||||
}
|
||||
|
||||
|
||||
public long getBrowser360SECount() {
|
||||
return browser360SECount;
|
||||
}
|
||||
|
||||
|
||||
public void setBrowser360SECount(long browser360seCount) {
|
||||
browser360SECount = browser360seCount;
|
||||
}
|
||||
|
||||
|
||||
public long getDeviceAndroidCount() {
|
||||
return deviceAndroidCount;
|
||||
}
|
||||
|
||||
|
||||
public void setDeviceAndroidCount(long deviceAndroidCount) {
|
||||
this.deviceAndroidCount = deviceAndroidCount;
|
||||
}
|
||||
|
||||
|
||||
public long getDeviceIpadCount() {
|
||||
return deviceIpadCount;
|
||||
}
|
||||
|
||||
|
||||
public void setDeviceIpadCount(long deviceIpadCount) {
|
||||
this.deviceIpadCount = deviceIpadCount;
|
||||
}
|
||||
|
||||
|
||||
public long getDeviceIphoneCount() {
|
||||
return deviceIphoneCount;
|
||||
}
|
||||
|
||||
|
||||
public void setDeviceIphoneCount(long deviceIphoneCount) {
|
||||
this.deviceIphoneCount = deviceIphoneCount;
|
||||
}
|
||||
|
||||
|
||||
public long getDeviceWindowsPhoneCount() {
|
||||
return deviceWindowsPhoneCount;
|
||||
}
|
||||
|
||||
|
||||
public void setDeviceWindowsPhoneCount(long deviceWindowsPhoneCount) {
|
||||
this.deviceWindowsPhoneCount = deviceWindowsPhoneCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBotCount() {
|
||||
return botCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBotCount(long botCount) {
|
||||
this.botCount = botCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBotBaiduCount() {
|
||||
return botBaiduCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBotBaiduCount(long botBaiduCount) {
|
||||
this.botBaiduCount = botBaiduCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBotYoudaoCount() {
|
||||
return botYoudaoCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBotYoudaoCount(long botYoudaoCount) {
|
||||
this.botYoudaoCount = botYoudaoCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBotGoogleCount() {
|
||||
return botGoogleCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBotGoogleCount(long botGoogleCount) {
|
||||
this.botGoogleCount = botGoogleCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBotMsnCount() {
|
||||
return botMsnCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBotMsnCount(long botMsnCount) {
|
||||
this.botMsnCount = botMsnCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBotBingCount() {
|
||||
return botBingCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBotBingCount(long botBingCount) {
|
||||
this.botBingCount = botBingCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBotSosoCount() {
|
||||
return botSosoCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBotSosoCount(long botSosoCount) {
|
||||
this.botSosoCount = botSosoCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBotSogouCount() {
|
||||
return botSogouCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBotSogouCount(long botSogouCount) {
|
||||
this.botSogouCount = botSogouCount;
|
||||
}
|
||||
|
||||
|
||||
public long getBotYahooCount() {
|
||||
return botYahooCount;
|
||||
}
|
||||
|
||||
|
||||
public void setBotYahooCount(long botYahooCount) {
|
||||
this.botYahooCount = botYahooCount;
|
||||
}
|
||||
|
||||
|
||||
public long getJdbcExecuteTimeMillis() {
|
||||
return getJdbcExecuteTimeNano() / (1000 * 1000);
|
||||
}
|
||||
@@ -679,5 +764,5 @@ public class WebAppStatValue {
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -21,50 +21,99 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.druid.support.monitor.MField;
|
||||
import com.alibaba.druid.support.monitor.dao.MTable;
|
||||
import com.alibaba.druid.support.profile.ProfileEntryStatValue;
|
||||
|
||||
@MTable(name = "druid_weburi")
|
||||
public class WebURIStatValue {
|
||||
|
||||
@MField
|
||||
protected String uri;
|
||||
|
||||
@MField
|
||||
protected int runningCount;
|
||||
|
||||
@MField
|
||||
protected int concurrentMax;
|
||||
|
||||
@MField
|
||||
protected long requestCount;
|
||||
|
||||
@MField
|
||||
protected long requestTimeNano;
|
||||
|
||||
@MField
|
||||
protected long jdbcFetchRowCount;
|
||||
|
||||
@MField
|
||||
protected long jdbcFetchRowPeak;
|
||||
|
||||
@MField
|
||||
protected long jdbcUpdateCount;
|
||||
|
||||
@MField
|
||||
protected long jdbcUpdatePeak;
|
||||
|
||||
@MField
|
||||
protected long jdbcExecuteCount;
|
||||
|
||||
@MField
|
||||
protected long jdbcExecuteErrorCount;
|
||||
|
||||
@MField
|
||||
protected long jdbcExecutePeak; // 单次请求执行SQL次数的峰值
|
||||
|
||||
@MField
|
||||
protected long jdbcExecuteTimeNano;
|
||||
|
||||
@MField
|
||||
protected long jdbcCommitCount;
|
||||
|
||||
@MField
|
||||
protected long jdbcRollbackCount;
|
||||
|
||||
@MField
|
||||
protected long jdbcPoolConnectionOpenCount;
|
||||
|
||||
@MField
|
||||
protected long jdbcPoolConnectionCloseCount;
|
||||
|
||||
@MField
|
||||
protected long jdbcResultSetOpenCount;
|
||||
|
||||
@MField
|
||||
protected long jdbcResultSetCloseCount;
|
||||
|
||||
@MField
|
||||
protected long errorCount;
|
||||
|
||||
@MField
|
||||
protected long lastAccessTimeMillis = -1L;
|
||||
|
||||
private List<ProfileEntryStatValue> profileEntryStatValueList;
|
||||
|
||||
@MField(name = "h1")
|
||||
protected long histogram_0_1;
|
||||
|
||||
@MField(name = "h10")
|
||||
protected long histogram_1_10;
|
||||
|
||||
@MField(name = "h100")
|
||||
protected long histogram_10_100;
|
||||
@MField(name = "h1000")
|
||||
protected long histogram_100_1000;
|
||||
|
||||
@MField(name = "h10000")
|
||||
protected int histogram_1000_10000;
|
||||
|
||||
@MField(name = "h100000")
|
||||
protected int histogram_10000_100000;
|
||||
|
||||
@MField(name = "h1000000")
|
||||
protected int histogram_100000_1000000;
|
||||
|
||||
@MField(name = "hmore")
|
||||
protected int histogram_1000000_more;
|
||||
|
||||
public long[] getHistogram() {
|
||||
|
||||
@@ -21,7 +21,8 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER })
|
||||
@Target({ ElementType.FIELD })
|
||||
public @interface MField {
|
||||
|
||||
String name() default "";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.alibaba.druid.support.monitor.dao;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE })
|
||||
public @interface MTable {
|
||||
|
||||
String name();
|
||||
}
|
||||
@@ -180,8 +180,8 @@ public class MonitorDaoJdbcImpl implements MonitorDao {
|
||||
return sql;
|
||||
}
|
||||
|
||||
protected String getTableName(BeanInfo beanInfo) {
|
||||
return "druid_sql";
|
||||
public String getTableName(BeanInfo beanInfo) {
|
||||
return beanInfo.getTableName();
|
||||
}
|
||||
|
||||
protected long getSqlHash(String sql) {
|
||||
@@ -225,9 +225,20 @@ public class MonitorDaoJdbcImpl implements MonitorDao {
|
||||
private final Class<?> clazz;
|
||||
private final List<FieldInfo> fields = new ArrayList<FieldInfo>();
|
||||
private String insertSql;
|
||||
private String tableName;
|
||||
|
||||
public BeanInfo(Class<?> clazz){
|
||||
this.clazz = clazz;
|
||||
|
||||
{
|
||||
MTable annotation = clazz.getAnnotation(MTable.class);
|
||||
if (annotation == null) {
|
||||
throw new IllegalArgumentException(clazz.getName() + " not contains @MTable");
|
||||
}
|
||||
|
||||
tableName = annotation.name();
|
||||
}
|
||||
|
||||
for (Field field : JdbcSqlStatValue.class.getDeclaredFields()) {
|
||||
MField annotation = field.getAnnotation(MField.class);
|
||||
if (annotation == null) {
|
||||
@@ -243,6 +254,10 @@ public class MonitorDaoJdbcImpl implements MonitorDao {
|
||||
}
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public Class<?> getClazz() {
|
||||
return clazz;
|
||||
}
|
||||
|
||||
@@ -19,43 +19,102 @@ import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.druid.support.monitor.MField;
|
||||
import com.alibaba.druid.support.monitor.dao.MTable;
|
||||
import com.alibaba.druid.util.Utils;
|
||||
|
||||
@MTable(name = "druid_springmethod")
|
||||
public class SpringMethodStatValue {
|
||||
|
||||
private String className;
|
||||
private String signature;
|
||||
@MField
|
||||
private String className;
|
||||
|
||||
private int runningCount;
|
||||
private int concurrentMax;
|
||||
private long executeCount;
|
||||
private long executeErrorCount;
|
||||
private long executeTimeNano;
|
||||
@MField
|
||||
private String signature;
|
||||
|
||||
private long jdbcFetchRowCount;
|
||||
private long jdbcUpdateCount;
|
||||
private long jdbcExecuteCount;
|
||||
private long jdbcExecuteErrorCount;
|
||||
private long jdbcExecuteTimeNano;
|
||||
@MField
|
||||
private int runningCount;
|
||||
|
||||
private long jdbcCommitCount;
|
||||
private long jdbcRollbackCount;
|
||||
@MField
|
||||
private int concurrentMax;
|
||||
|
||||
private long jdbcPoolConnectionOpenCount;
|
||||
private long jdbcPoolConnectionCloseCount;
|
||||
@MField
|
||||
private long executeCount;
|
||||
|
||||
private long jdbcResultSetOpenCount;
|
||||
private long jdbcResultSetCloseCount;
|
||||
@MField
|
||||
private long executeErrorCount;
|
||||
|
||||
private Throwable lastError;
|
||||
private long lastErrorTimeMillis;
|
||||
@MField
|
||||
private long executeTimeNano;
|
||||
|
||||
long histogram_0_1;
|
||||
long histogram_1_10;
|
||||
long histogram_10_100;
|
||||
long histogram_100_1000;
|
||||
int histogram_1000_10000;
|
||||
int histogram_10000_100000;
|
||||
int histogram_100000_1000000;
|
||||
int histogram_1000000_more;
|
||||
@MField
|
||||
private long jdbcFetchRowCount;
|
||||
|
||||
@MField
|
||||
private long jdbcUpdateCount;
|
||||
|
||||
@MField
|
||||
private long jdbcExecuteCount;
|
||||
|
||||
@MField
|
||||
private long jdbcExecuteErrorCount;
|
||||
|
||||
@MField
|
||||
private long jdbcExecuteTimeNano;
|
||||
|
||||
@MField
|
||||
private long jdbcCommitCount;
|
||||
|
||||
@MField
|
||||
private long jdbcRollbackCount;
|
||||
|
||||
@MField
|
||||
private long jdbcPoolConnectionOpenCount;
|
||||
|
||||
@MField
|
||||
private long jdbcPoolConnectionCloseCount;
|
||||
|
||||
@MField
|
||||
private long jdbcResultSetOpenCount;
|
||||
|
||||
@MField
|
||||
private long jdbcResultSetCloseCount;
|
||||
|
||||
@MField
|
||||
private String lastErrorClass;
|
||||
|
||||
@MField
|
||||
private String lastErrorMessage;
|
||||
|
||||
@MField
|
||||
private String lastErrorStackTrace;
|
||||
|
||||
@MField
|
||||
private long lastErrorTimeMillis;
|
||||
|
||||
@MField(name = "h1")
|
||||
long histogram_0_1;
|
||||
|
||||
@MField(name = "h10")
|
||||
long histogram_1_10;
|
||||
|
||||
@MField(name = "h100")
|
||||
long histogram_10_100;
|
||||
|
||||
@MField(name = "h1000")
|
||||
long histogram_100_1000;
|
||||
|
||||
@MField(name = "h10000")
|
||||
int histogram_1000_10000;
|
||||
|
||||
@MField(name = "h100000")
|
||||
int histogram_10000_100000;
|
||||
|
||||
@MField(name = "h1000000")
|
||||
int histogram_100000_1000000;
|
||||
|
||||
@MField(name = "hmore")
|
||||
int histogram_1000000_more;
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
@@ -201,12 +260,12 @@ public class SpringMethodStatValue {
|
||||
this.jdbcResultSetCloseCount = jdbcResultSetCloseCount;
|
||||
}
|
||||
|
||||
public Throwable getLastError() {
|
||||
return lastError;
|
||||
}
|
||||
|
||||
public void setLastError(Throwable lastError) {
|
||||
this.lastError = lastError;
|
||||
if (lastError != null) {
|
||||
lastErrorClass = lastError.getClass().getName();
|
||||
lastErrorMessage = lastError.getMessage();
|
||||
lastErrorStackTrace = Utils.toString(lastError.getStackTrace());
|
||||
}
|
||||
}
|
||||
|
||||
public long getLastErrorTimeMillis() {
|
||||
@@ -274,11 +333,20 @@ public class SpringMethodStatValue {
|
||||
data.put("JdbcFetchRowCount", this.getJdbcFetchRowCount());
|
||||
data.put("JdbcUpdateCount", this.getJdbcUpdateCount());
|
||||
|
||||
data.put("LastError", this.getLastError());
|
||||
if (this.lastErrorClass == null) {
|
||||
data.put("LastError", null);
|
||||
} else {
|
||||
Map<String, Object> map = new LinkedHashMap<String, Object>(3);
|
||||
map.put("Class", lastErrorClass);
|
||||
map.put("Message", lastErrorMessage);
|
||||
map.put("StackTrace", lastErrorStackTrace);
|
||||
data.put("LastError", map);
|
||||
}
|
||||
|
||||
data.put("LastErrorTime", this.getLastErrorTime());
|
||||
|
||||
data.put("Histogram", this.getHistogram());
|
||||
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,19 +150,6 @@ public class Utils {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public static String toString(Throwable error) {
|
||||
if (error == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
StringWriter strWriter = new StringWriter();
|
||||
PrintWriter out = new PrintWriter(strWriter);
|
||||
error.printStackTrace(out);
|
||||
out.close();
|
||||
String text = strWriter.toString();
|
||||
return text;
|
||||
}
|
||||
|
||||
public static String toString(StackTraceElement[] stackTrace) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (StackTraceElement item : stackTrace) {
|
||||
|
||||
Reference in New Issue
Block a user