Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to find total active session at the given moment  RSS feed

 
Raghuveer Rawat
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I want to find total active session at a given moment.
can anyone tell me this.
Thanks
 
qingwu wang
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use the HttpSessionListener interface to achieve that.
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sample code that does just that (and more) can be found at http://www.javaperformancetuning.com/tools/jamon/#SampleCode. JAMon is an easy to use (a start() and stop() method) API that measures performance, scalability and counts "things" in general. For example in your case you could count sessions.
steve - http://www.jamonapi.com
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!