• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Count of the clients accessing the server

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are the possible ways to count the number of clients and the pages that they are accessing the server at any time ?
 
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I wouldn't see this as being a 'java' thing since most wbservers logs can be run through a stats program and give you all this info.
BUT
I might look at this in the following way:
Create your own class that is 'called' on each page. It can track the IP/sessionID and keep a count of 'unique' hits, and then of all the pages these people request.
Want to know how many people are 'online'? Make a static method/field that counts the instances of this class, find some creative way to use 'finally' to deduct from this total before it's all garbage collected and you've got some pretty interesting information.
Store these in a database, package it with a nice reporting tool and you've got yourself a 'web' stats program.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you John
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic