Keep It Simple, Stupid | |
PerlMonks |
Re: (z) Re: How to do session times The Right Wayby strider corinth (Friar) |
on Oct 31, 2002 at 18:54 UTC ( [id://209480]=note: print w/replies, xml ) | Need Help?? |
For intervals, I'm impressed: this is a really inventive solution. I definitely think it would work well for that. The only problems I see are if I'm looking for a point in time, or if a user is logged in for a shorter period of time than the interval of the checkpoints. The point won't be accurate because logoff times are only available by the hour (we don't know if the user was logged off by, say, 1:32:56). The short time won't work because no data will be recorded on it at all. I think a slight modification of this system would work well for all situations. At each interval (each hour, let's say) let the system log all the users online and the time they logged on. The same record is updated with the stop times of all users who off during that hour. That way, to find out how many users were on at 1:32:56, the script only needs to look at the entry for 1:00. Any users logged on at 1:00 who hadn't yet logged off at 1:32:56 were online at that time. The only problem left in that scenario is of users who log on after 1:00 and off before 2:00, leaving only a logoff record in the 2:00 entry. If each entry logs any logons for that hour as well, the problem is solved with just a little more computing, and still looking only at one record. -- Love justice; desire mercy.
In Section
Seekers of Perl Wisdom
|
|