public int getRowCount() { return txnmgr.getActiveSessions(); } @Override
private AbstractTableModel createModel () { events = new TransactionStatusEvent[txnmgr.getActiveSessions()]; return new AbstractTableModel() { String[] columnName = new String[] {
@Override public void dump (PrintStream ps, String indent) { ps.printf ("%sin-transit=%d/%d, head=%d, tail=%d, paused=%d, outstanding=%d, active-sessions=%d/%d%s%n", indent, getActiveTransactions(), getInTransit(), head, tail, pausedCounter.get(), getOutstandingTransactions(), getActiveSessions(), maxSessions, (tps != null ? ", " + tps.toString() : "") ); if (metrics != null) { metrics.dump(ps, indent); } }
new Thread(() -> { int outstandingTransactions = getOutstandingTransactions(); int activeSessions = getActiveSessions(); if (activeSessions < maxSessions && outstandingTransactions > threshold) { int count = Math.min(outstandingTransactions, maxSessions - activeSessions);
@Override public void run() { Thread.currentThread().setName (getName()+"-input-queue-monitor"); while (running()) { while (getOutstandingTransactions() > getActiveSessions() + threshold && running()) { ISOUtil.sleep(100L); } if (!running()) break; try { Object context = isp.in(queue, 1000L); if (context != null) { if (!running()) { isp.out(queue, context); // place it back break; } iisp.out(queue, context); } } catch (SpaceError e) { getLog().error(e); ISOUtil.sleep(1000L); // relax on error } } } }
if (session+1 > sessions && getActiveSessions() > sessions) break; // we are an extra session, exit else { String.format (" in-transit=%d, head=%d, tail=%d, paused=%d, outstanding=%d, active-sessions=%d/%d, %s, elapsed=%dms", getInTransit(), head, tail, pausedCounter.get(), getOutstandingTransactions(), getActiveSessions(), maxSessions, tps.toString(), prof != null ? prof.getElapsedInMillis() : -1