At the moment this is a toy project, a proof of concept. In places it is quite simplistic, not robust, no tests. So use it at your own risk.
If you are looking for something like this to use in combination with the ZODB, you may also want to have a look at https://github.com/davisagli/collective.firehose
The main idea is that we use Redis to keep a few counters of visits to web pages.
There are a few elements in this code:
buildout.cfgso you can use buildout to set everything up for testing. Tested with Python 2.6.
- A Redis server, setup by buildout. Start it with
rediscounterPython package, with some code for increasing a counter in Redis and getting its value (hardly rocket science) using the redis Python package, and some WSGI code.
- A Paste server with two pipelines. Start it with
bin/paster serve --reload devel.ini. It is currently setup to serve on http://127.0.0.1:4000/.
- One Paste pipelins is the filter from this
rediscounterpackage. It gets html from http://zestsoftware.nl/ as an example. While doing this, it updates a total counter and a count of visits to the current page. It inserts those statistics into the html, to show that it is active and working.