[erlang-questions] count events within last XX minutes
Max Bourinov
bourinov@REDACTED
Fri Aug 24 16:16:51 CEST 2012
Dear Erlangers,
Does anybody know best memory efficient way to count events within last XX
minutes?
So far I have the following idea: For each counter I have a process. The
counter process has a list of XX items. Each item represents a certain
minute, so I always know where is my current counter. There is also must be
a mechanism to remove last item from the list and add a new one. Summing
values from all items is a number of events within last XX minutes. This is
it.
Maybe there is a ready lib that does the same in a better way?
Any suggestions are welcome!
Best regards,
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120824/786f7fa3/attachment.htm>
More information about the erlang-questions
mailing list