@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); } }
public void update(TransactionStatusEvent e) { if (ui.isDestroyed()) { return; } int row = e.getSession(); events[row] = e; model.fireTableRowsUpdated(row, row); // table.getSelectionModel().setSelectionInterval(row, row); setBackgroundColor (row, color[e.getState().intValue()]); inTransit.setText (Long.toString (txnmgr.getInTransit())); outstanding.setText (Long.toString (txnmgr.getOutstandingTransactions())); } private void setBackgroundColor (int row, Color color) {
loadMonitorExecutor.scheduleAtFixedRate( new Thread(() -> { int outstandingTransactions = getOutstandingTransactions(); int activeSessions = getActiveSessions(); if (activeSessions < maxSessions && outstandingTransactions > threshold) {
@Test public void testGetOutstandingTransactions() throws Throwable { int result = new TransactionManager().getOutstandingTransactions(); assertEquals("result", -1, result); }
@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 } } } }
getInTransit(), head, tail, pausedCounter.get(), getOutstandingTransactions(), getActiveSessions(), maxSessions, tps.toString(), prof != null ? prof.getElapsedInMillis() : -1