Forum OpenACS Development: Re: Get number of visitors currently browsing the site

Collapse
Posted by gustaf neumann on
I have improved our controling thread package described in
http://www.openacs.org/forums/message-view?message%5fid=203277
and among other things, it counts users by oacs-ids and by
their peer addresses.

It keeps these statistics for the last
10 minutes and for the last 24 hours, so one can get an idea
how many people (or peer addresses) used the site during the
last day as well. The IP-addresses are certainly not a
perfect measure, but still a good approaximization.

New in version 0.3 of the controlling thread package:
  - fixed a race condition during startup and heavy request traffic
    (could result in several controlling threads running)
  - keep peer address, timestamp and user activity
  - computes users in last 24 hours
  - adapted version of whos-online (shows activity and
    peer for sys admins, sort options)

You can see a sample screen shot of whos-online with
the user names blanked out here:
http://media.wu-wien.ac.at/download/whosonline.png

A sample display of the performance monitor is here:
http://media.wu-wien.ac.at/download/stat-2004-11-23a.htm

The updated version is in:
http://media.wu-wien.ac.at/download/throttle+stats0.3.tar.gz

best regards
-gustaf

Gustaf:

This is very interesting. Does the package require any changes to acs-core?

If not, would you consider uploading this code to openacs.org CVS?

I tried to make your code into an OpenACS package and stumbled upon some problems, which require changes to the ACS Core.

- The RP has to load .xotcl files as well
- thread::mutex does not work on my installation.

Maybe you can help me with the latter, so I could continue to make an openacs package out of it.

For thread::mutex to work, you presumably need to install the Tcl Threads Extension. The latest release supports AOLserver 4.x. Earlier releases support both AOLserver 3.x and 4.x.