}
public abstract int getActivePeak();
public CompositeDataSupport getCompositeData() throws JMException {
JdbcDataSourceStat stat = this.getDataSourceStat();
Map<String, Object> map = new HashMap<String, Object>();
map.put("ID", getID());
map.put("URL", this.getUrl());
map.put("Name", this.getName());
map.put("FilterClasses", getFilterClasses());
map.put("CreatedTime", getCreatedTime());
map.put("RawDriverClassName", getDriverClassName());
map.put("RawUrl", getUrl());
map.put("RawDriverMajorVersion", getRawDriverMajorVersion());
map.put("RawDriverMinorVersion", getRawDriverMinorVersion());
map.put("Properties", getProperties());
// 0 - 4
map.put("ConnectionActiveCount", (long) getActiveCount());
map.put("ConnectionActiveCountMax", getActivePeak());
map.put("ConnectionCloseCount", getCloseCount());
map.put("ConnectionCommitCount", getCommitCount());
map.put("ConnectionRollbackCount", getRollbackCount());
// 5 - 9
map.put("ConnectionConnectLastTime", stat.getConnectionStat().getConnectLastTime());
map.put("ConnectionConnectErrorCount", this.getCreateCount());
if (createError != null) {
map.put("ConnectionConnectErrorLastTime", getLastCreateErrorTime());
map.put("ConnectionConnectErrorLastMessage", createError.getMessage());
map.put("ConnectionConnectErrorLastStackTrace", IOUtils.getStackTrace(createError));
} else {
map.put("ConnectionConnectErrorLastTime", null);
map.put("ConnectionConnectErrorLastMessage", null);
map.put("ConnectionConnectErrorLastStackTrace", null);
}
// 10 - 14
map.put("StatementCreateCount", stat.getStatementStat().getCreateCount());
map.put("StatementPrepareCount", stat.getStatementStat().getPrepareCount());
map.put("StatementPreCallCount", stat.getStatementStat().getPrepareCallCount());
map.put("StatementExecuteCount", stat.getStatementStat().getExecuteCount());
map.put("StatementRunningCount", stat.getStatementStat().getRunningCount());
// 15 - 19
map.put("StatementConcurrentMax", stat.getStatementStat().getConcurrentMax());
map.put("StatementCloseCount", stat.getStatementStat().getCloseCount());
map.put("StatementErrorCount", stat.getStatementStat().getErrorCount());
map.put("StatementLastErrorTime", null);
map.put("StatementLastErrorMessage", null);
// 20 - 24
map.put("StatementLastErrorStackTrace", null);
map.put("StatementExecuteMillisTotal", stat.getStatementStat().getMillisTotal());
map.put("StatementExecuteLastTime", stat.getStatementStat().getExecuteLastTime());
map.put("ConnectionConnectingCount", stat.getConnectionStat().getConnectingCount());
map.put("ResultSetCloseCount", stat.getResultSetStat().getCloseCount());
// 25 - 29
map.put("ResultSetOpenCount", stat.getResultSetStat().getOpenCount());
map.put("ResultSetOpenningCount", stat.getResultSetStat().getOpenningCount());
map.put("ResultSetOpenningMax", stat.getResultSetStat().getOpenningMax());
map.put("ResultSetFetchRowCount", stat.getResultSetStat().getFetchRowCount());
map.put("ResultSetLastOpenTime", stat.getResultSetStat().getLastOpenTime());
// 30 - 34
map.put("ResultSetErrorCount", stat.getResultSetStat().getErrorCount());
map.put("ResultSetOpenningMillisTotal", stat.getResultSetStat().getAliveMillisTotal());
map.put("ResultSetLastErrorTime", stat.getResultSetStat().getLastErrorTime());
map.put("ResultSetLastErrorMessage", null);
map.put("ResultSetLastErrorStackTrace", null);
// 35 - 39
map.put("ConnectionConnectCount", this.getConnectCount());
if (createError != null) {
map.put("ConnectionErrorLastMessage", createError.getMessage());
map.put("ConnectionErrorLastStackTrace", IOUtils.getStackTrace(createError));
} else {
map.put("ConnectionErrorLastMessage", null);
map.put("ConnectionErrorLastStackTrace", null);
}
map.put("ConnectionConnectMillisTotal", stat.getConnectionStat().getConnectMillis());
map.put("ConnectionConnectingCountMax", stat.getConnectionStat().getConnectingMax());
// 40 - 44
map.put("ConnectionConnectMillisMax", stat.getConnectionStat().getConnectMillisMax());
map.put("ConnectionErrorLastTime", stat.getConnectionStat().getErrorLastTime());
map.put("ConnectionAliveMillisMax", stat.getConnectionConnectAliveMillisMax());
map.put("ConnectionAliveMillisMin", stat.getConnectionConnectAliveMillisMin());
map.put("ConnectionHistogram", stat.getConnectionHistogramValues());
map.put("StatementHistogram", stat.getStatementStat().getHistogramValues());
return new CompositeDataSupport(JdbcStatManager.getDataSourceCompositeType(), map);
}