mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
SqlStat添加DbType字段
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@182 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -112,6 +112,8 @@ public class SQLParser {
|
||||
private int errorEndPos = -1;
|
||||
|
||||
protected void setErrorEndPos(int errPos) {
|
||||
if (errPos > errorEndPos) errorEndPos = errPos;
|
||||
if (errPos > errorEndPos) {
|
||||
errorEndPos = errPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public final class JdbcSqlStat implements JdbcSqlStatMBean {
|
||||
private final AtomicLong concurrentMax = new AtomicLong();
|
||||
private String name;
|
||||
private String file;
|
||||
private String dbType;
|
||||
|
||||
private long executeNanoSpanMaxOccurTime;
|
||||
|
||||
@@ -60,6 +61,14 @@ public final class JdbcSqlStat implements JdbcSqlStatMBean {
|
||||
private final AtomicLong updateCount = new AtomicLong();
|
||||
private final AtomicLong fetchRowCount = new AtomicLong();
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
|
||||
public String getDataSource() {
|
||||
return dataSource;
|
||||
}
|
||||
@@ -310,11 +319,11 @@ public final class JdbcSqlStat implements JdbcSqlStatMBean {
|
||||
OpenType<?>[] indexTypes = new OpenType<?>[] { SimpleType.LONG, SimpleType.STRING, SimpleType.STRING, SimpleType.LONG, SimpleType.LONG,
|
||||
SimpleType.LONG, SimpleType.DATE, SimpleType.LONG, JMXUtils.getThrowableCompositeType(), SimpleType.LONG, SimpleType.LONG, SimpleType.DATE,
|
||||
SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
|
||||
SimpleType.STRING, SimpleType.DATE };
|
||||
SimpleType.STRING, SimpleType.DATE, SimpleType.STRING };
|
||||
|
||||
String[] indexNames = { "ID", "DataSource", "SQL", "ExecuteCount", "ErrorCount", "TotalTime", "LastTime", "MaxTimespan", "LastError",
|
||||
"EffectedRowCount", "FetchRowCount", "MaxTimespanOccurTime", "BatchSizeMax", "BatchSizeTotal", "ConcurrentMax", "RunningCount", "Name", "File",
|
||||
"LastErrorMessage", "LastErrorClass", "LastErrorStackTrace", "LastErrorTime" };
|
||||
"LastErrorMessage", "LastErrorClass", "LastErrorStackTrace", "LastErrorTime", "DbType" };
|
||||
String[] indexDescriptions = indexNames;
|
||||
COMPOSITE_TYPE = new CompositeType("SqlStatistic", "Sql Statistic", indexNames, indexDescriptions, indexTypes);
|
||||
|
||||
@@ -366,6 +375,8 @@ public final class JdbcSqlStat implements JdbcSqlStatMBean {
|
||||
map.put("LastErrorTime", null);
|
||||
}
|
||||
|
||||
map.put("DbType", dbType);
|
||||
|
||||
return new CompositeDataSupport(getCompositeType(), map);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user