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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.