Couchdb runtime statistics viewer
posted on 05 Jan 2010CouchDB comes with a runtime statistics module that lets you inspect how CouchDB performs. The statistics module collects metrics like requests per second, request sizes and a multitude of other useful stuff. From Couchdb wiki. I created a simple app that uses chronoscope to display how some metrics change over time. Jump to the demo, go to the source or use the docs.
Install
couchdb-stats is a simple couchapp plus a python script that hits /_stats and stores the results in couchdb server Attention: this app is tested with Couchdb 0.11.x, not yet released at the time of this post.
$ git clone git://github.com/mcaprari/couchdb-stats.git $ cd couchdb-stats $ couchapp push app http://localhost:5984/stats $ python stats_copy.py localhost localhost stats 60
Couchdb reports metrics since server start or of the last 1, 5 or 15 minutes. There is no way to see yesterday's stats. To do that, we need to keep hitting /_stats and store results in a couchdb database. stats_copy.py does just that.
At this point it's possible to write several views, each focused on a particular metric. See the documentation for more details.
questions, comments and suggestions welcome