Build an Event Counter
Budget: $30 – $250 USD
Project: Event Counter
Write a small library to track the number of events that happened during a recent window of time. As an example, it might be used to track how often a particular webpage is served.
The library should support two operations:
Increment - track a single event occurrence.
Get Count - return the total number of events that occurred during the last N seconds, where N is a user-provided argument. You may limit N to a reasonable upper bound, like 10 minutes.
You may define the specific interface your library provides in order to support the operations described above.
Only track counts. You do not have to track any data payload associated with an event.
Track counts in memory. Do not persist data to longer term storage.
You do not have to consider thread safety or multi-threading.
Write the library in Python3.
It doesn't introduce negative side effects like excessive memory use/leaks under persistent high-volume usage (e.g.: 1 million events per second).
write readable, well-structured code.
You do not need to provide a client for the library (i.e. a program that uses the library).
Testing and Documentation
write the code to be at the bar that you consider "production quality."
it includes:
Robust, meaningful tests
Clear documentation
From another perspective, the library should be in well maintainable form.
Write a small library to track the number of events that happened during a recent window of time. As an example, it might be used to track how often a particular webpage is served.
The library should support two operations:
Increment - track a single event occurrence.
Get Count - return the total number of events that occurred during the last N seconds, where N is a user-provided argument. You may limit N to a reasonable upper bound, like 10 minutes.
You may define the specific interface your library provides in order to support the operations described above.
Only track counts. You do not have to track any data payload associated with an event.
Track counts in memory. Do not persist data to longer term storage.
You do not have to consider thread safety or multi-threading.
Write the library in Python3.
It doesn't introduce negative side effects like excessive memory use/leaks under persistent high-volume usage (e.g.: 1 million events per second).
write readable, well-structured code.
You do not need to provide a client for the library (i.e. a program that uses the library).
Testing and Documentation
write the code to be at the bar that you consider "production quality."
it includes:
Robust, meaningful tests
Clear documentation
From another perspective, the library should be in well maintainable form.
Related categories:
Python
Engineering
Software Architecture
Software Testing
Software Documentation