Page 1 of 1

Monitoring system - few specifications

Posted: Sat May 31, 2008 10:39 am
by Consolas
Hello everyone

I want / need to implement a monitoring system into my website.

It should have the following specifications:
- how many times a user has logged on
- for how long has the user been logged on
- what pages whithin the site has the user visited
- how any times, if any, has the user changed password

I need to have a page monitoring has well:
- how many times has the page been visited

I was thinking of making this using classes, i think its the most appropriate. What i'm here to ask is what logic should i follow..

Should i have a main class called, for instance, monitoring and then 2 extends one for user_monitoring and another for page_monitoring?

Then on each extend i would have the functions that would insert into the database ( or update ) the information regarding the user / page. If a user entered a site, i would have a new user_monitoring("site_the_user_clicked") for instance, and on that class i would have an insert into a database of the site and user in question.


What do you think?

Thank you!!!

Ricardo

Re: Monitoring system - few specifications

Posted: Sat May 31, 2008 11:22 pm
by Mordred
I imagine it should be centered on the ++ idea. :lol: :twisted:

Seriously, you don't need much of a class hyerarchy - just a container for all the counters and hook functions to be called when the events in question happen. If it ever comes to "monitoring" something that doesn't fit the scheme, refactor accordingly. Don't overkill it from step 0.

Re: Monitoring system - few specifications

Posted: Tue Jun 03, 2008 8:15 pm
by Ambush Commander
First and foremost, you need an effective system of logging important events. "for how long has the user been logged on" is not an event per se; you can measure the logon, but it's exceedingly difficult to tell when a user has logged off. Somehow, however, the log-off event has to be called.

Other than that, a basic logging system would do well, with a few types of meta-data to make it easy to extract particular events from one user, and another class to crunch the data and turn it into something human readable; it would also be a good idea to cache those calculations and update the cache incrementally.