mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
增强监控
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@553 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -18,6 +18,7 @@ package com.alibaba.druid.pool;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
@@ -129,4 +130,26 @@ public final class ConnectionHolder {
|
||||
}
|
||||
statementTrace.clear();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
|
||||
buf.append("{ID:");
|
||||
buf.append(System.identityHashCode(conn));
|
||||
buf.append(", ConnectTime:\"");
|
||||
buf.append(JdbcUtils.toString(new Date(this.connecttimeMillis)));
|
||||
|
||||
buf.append("\", UseCount:");
|
||||
buf.append(useCount);
|
||||
|
||||
if (lastActiveTimeMillis > 0) {
|
||||
buf.append(", LastActiveTime:\"");
|
||||
buf.append(JdbcUtils.toString(new Date(this.lastActiveTimeMillis)));
|
||||
buf.append("\"");
|
||||
}
|
||||
|
||||
buf.append("}");
|
||||
|
||||
return buf.toString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user