tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: svn commit: r1036021 - /tomcat/trunk/test/org/apache/catalina/session/
Date Wed, 17 Nov 2010 23:15:43 GMT
On 17/11/2010 19:49, Konstantin Kolinko wrote:
> My impression looking on the above cited code of StandardSession is
> that all that arithmetics should be done inside the manager.
> Then the manager can be optimized how to store it.

+1, although it is slightly complicated by the PersistentManager that 
can call Manager.remove() when the session hasn't expired. Also, I don't 
think this is a bottleneck we need to worry about too much right now.

> E.g., unless someone calls getSessionAverageAliveTime() the value of
> average = (int) (((average * (numExpired-1)) + timeAlive)/numExpired);
> is not needed.

I think it is due to the way the average is maintained. It needs to be 
updated on every expiration. I'll see if a better option emerges when I 
add the rate of creatation/destruction stats.

> Also that call can be moved out of synchronized(this).

I don't think so, given the way it is currently calculated. Again, I'll 
see if a better solution emerges when I add the other stats.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message