Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Re: Re: How to do session times The Right Wayby alien_life_form (Pilgrim) |
on Nov 02, 2002 at 09:30 UTC ( [id://209933]=note: print w/replies, xml ) | Need Help?? |
Greetings, Solution 2 does in fact refer to the idea of keeping a running count, however, the idea of "running through" sort of goes away. I am proposing of keeping a two column (list, table, tabulation...):
If this seems unelegant, the proces doing the event logging could perhaps be hacked to also increment/decrement the count as the events arrive. (Of course, in a situation where you may not have reliable termination events - like weblogs - everything beomes more complex...) The use of a DBMS does in fact mean that you set up a data structure for your data (your #1 idea), but the critical pint is that it is a data structure that is highly optimized for searching, sorting and counting - and that is not a trivial addition. Besides, the kind of tables that other have proposed have the virtue of making many more type of questions answerable by simple SQL means. OTOH, the table outlined above is minimally tuned to answer the "how many" questions without any information loss (entailed by any periodic sampling)
And I should mention that, if I had to do it, I would probably try to set it up in MRTG, which is probably already 75% there. Of course, MRTG does use periodic sampling and reaggregates its data set on the basis of a larger time step for the weekly and monthly stats, which is a lossy process.
You can't have everything: where would you put it?
In Section
Seekers of Perl Wisdom
|
|