Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding Servlets

 
sirisha makkapati
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is sirisha I have a Doubt any one Can Help Me?

How Can we find How many Users are accessing one website at any moment of time?

Thanks && Regards,
Sirisha.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about using a HttpSessionListener ?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How many Users are accessing one website at any moment of time?


That depends on how you interpret the phrase. Watching sessions will give you some idea of the number of active Users in recent history but some will be long gone by the time their session times out. Using Tomcat's management interface I can see how many Threads are currently handling requests - is that what you had in mind? You could always increment (safely) a counter when the service method is entered and decrement it when exited.

Bill
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see: UseAMeaningfulSubjectLine

Every question in the forum is "Regarding Servlets" so your subject line really tells us nothing about your question.

I've got a sample webapp on my site that shows one way of keeping track of sessions, who's logged in, how long they've been logged in, and what page they've accessed last.
You can find it at:
http://simple.souther.us/not-so-simple.html
Look for SessionMonitor.

-Ben
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic