Hi Clint, On Sat, Sep 12, 2009 at 8:06 AM, Clint Webb <[email protected]> wrote: > > > On Sat, Sep 12, 2009 at 2:56 AM, Adam Lee <[email protected]> wrote: >> >> We expire counters when we want to track something by time period... >> > > Sorry mate, I didn't mean to reply to your email directly. I agree with how > you are doing it, I was actually talking about the original poster of this > thread. >
I've been thinking before I responded, and here are a few observations: * If you just wanted to track the amount of things done in a given period since the first occurrence of an event, then the expiration set on the first event should suffice. * If you want to limit the cumulative occurrence of things within certain time periods, then you need to be able to extend the expiration. This means sure, if you just want to make sure users can only do 10 things in 5 seconds, then you track from the first occurrence of that "thing they did" and let the 5 seconds expire. If you however want to say "just do 10 things within 5 seconds of each occurrence" then you can't just track from the first occurrence. This is the kind of behavior I would like to be able to track -- for example, track each user and flag those that do 10 things within 2 second of each occurence. I hope this makes sense and it may be a valid need for not only me but others using memcached. -- Dean Michael Berris blog.cplusplus-soup.com | twitter.com/mikhailberis linkedin.com/in/mikhailberis | facebook.com/dean.berris | deanberris.com
