private void bruteForceCleanup(String realId, Exception ex) { log_.warn("Standard expiration of session " + realId + " failed; switching to a brute " + "force cleanup. Problem is" + ex.getLocalizedMessage()); try { proxy_.removeSessionLocal(realId, null); } catch (Exception e) { log_.error("processExpirationPassivation(): Caught exception " + "during brute force cleanup of unloaded session " + realId + " session will be removed from Manager " + "but may still exist in distributed cache", e); } finally { // Get rid of our refs even if distributed store fails unloadedSessions_.remove(realId); stats_.removeStats(realId); } }
Map<String, ReplicationStatistics.TimeStatistic> stats = stats_.getStats(); ReplicationStatistics.TimeStatistic stat = (ReplicationStatistics.TimeStatistic) stats.get(sessionId);
public void updatePassivationStats(String ctx, long elapsed) { TimeStatistic stat = getTimeStatistic(ctx); stat.totalPassivationTime += elapsed; if( stat.minPassivationTime > elapsed ) stat.minPassivationTime = elapsed; if( stat.maxPassivationTime < elapsed ) stat.maxPassivationTime = elapsed; }
public boolean storeSession(Session baseSession) { boolean stored = false; if (baseSession != null && started_) { ClusteredSession session = (ClusteredSession) baseSession; synchronized (session) { if (logger.isDebugEnabled()) { log_.debug("check to see if needs to store and replicate " + "session with id " + session.getIdInternal()); } if (session.isValid() && (session.isSessionDirty() || session .getExceedsMaxUnreplicatedInterval())) { String realId = session.getRealId(); // Notify all session attributes that they get serialized // (SRV 7.7.2) long begin = System.currentTimeMillis(); session.passivate(); long elapsed = System.currentTimeMillis() - begin; stats_.updatePassivationStats(realId, elapsed); // Do the actual replication begin = System.currentTimeMillis(); processSessionRepl(session); elapsed = System.currentTimeMillis() - begin; stored = true; stats_.updateReplicationStats(realId, elapsed); } } } return stored; }
stats_.updateLoadStats(realId, elapsed);
/** * {@inheritDoc} */ public void resetStats() { stats_.resetStats(); maxActiveCounter_.set(localActiveCounter_.get()); rejectedCounter_.set(0); createdCounter_.set(0); expiredCounter_.set(0); processingTime_.set(0); maxAliveTime.set(0); averageAliveTime.set(0); duplicates_.set(0); timeSinceLastReset_ = System.currentTimeMillis(); }
session.passivate(); long elapsed = System.currentTimeMillis() - begin; stats_.updatePassivationStats(realId, elapsed); elapsed = System.currentTimeMillis() - begin; stored = true; stats_.updateReplicationStats(realId, elapsed);
add(session, false); // don't replicate long elapsed = System.currentTimeMillis() - begin; stats_.updateLoadStats(realId, elapsed);
session.notifyWillPassivate(ClusteredSessionNotificationCause.REPLICATION); long elapsed = System.currentTimeMillis() - begin; stats_.updatePassivationStats(realId, elapsed); elapsed = System.currentTimeMillis() - begin; stored = true; stats_.updateReplicationStats(realId, elapsed);
session.initAfterLoad(this); long elapsed = System.currentTimeMillis() - begin; stats_.updateLoadStats(key.toString(), elapsed);
public void updateLoadStats(String ctx, long elapsed) { TimeStatistic stat = getTimeStatistic(ctx); stat.loadCount ++; stat.totalLoadlTime += elapsed; if( stat.minLoadTime > elapsed ) stat.minLoadTime = elapsed; if( stat.maxLoadTime < elapsed ) stat.maxLoadTime = elapsed; }
Map<String, ReplicationStatistics.TimeStatistic> copy = new HashMap<String, ReplicationStatistics.TimeStatistic>(stats_.getStats()); for (Map.Entry<String, ReplicationStatistics.TimeStatistic> entry : copy.entrySet())
session.passivate(); long elapsed = System.currentTimeMillis() - begin; stats_.updatePassivationStats(realId, elapsed); elapsed = System.currentTimeMillis() - begin; stored = true; stats_.updateReplicationStats(realId, elapsed);
session.initAfterLoad(this); long elapsed = System.currentTimeMillis() - begin; stats_.updateLoadStats(key.toString(), elapsed);
/** Update the TimeStatistic for the given ctx. This does not synchronize * on the TimeStatistic so the results are an approximate values. * * @param ctx the method to update the statistics for. * @param elapsed the elapsed time in milliseconds for the invocation. */ public void updateReplicationStats(String ctx, long elapsed) { TimeStatistic stat = getTimeStatistic(ctx); stat.replicationCount ++; stat.totalReplicationlTime += elapsed; if( stat.minReplicationTime > elapsed ) stat.minReplicationTime = elapsed; if( stat.maxReplicationTime < elapsed ) stat.maxReplicationTime = elapsed; }
tmp.append("<th>totalLoadTime</th>"); Map<String, ReplicationStatistics.TimeStatistic> copy = new HashMap<String, ReplicationStatistics.TimeStatistic>(stats_.getStats()); for (Map.Entry<String, ReplicationStatistics.TimeStatistic> entry : copy.entrySet())
stats_.removeStats(realId); stats_.removeStats(realId);