pepyatka / pepyatka-server

Server for Pepyatka
79 stars 27 forks source link

Add optional statistics for Redis queries. #208

Open yole opened 9 years ago

yole commented 9 years ago

If config.redis.analyze_performance is enabled, log the number and types of Redis queries executed on each request.

epicmonkey commented 9 years ago

Let's discuss, i.e. there are external tools that can gather pretty much the same stats using either INFO or MONITOR redis commands. For example: https://github.com/facebookarchive/redis-faina

yole commented 9 years ago

Do you know of any external tool which can correlate the stats with the URL being requested? It's not interesting for me to simply see how many operations of a certain kind we're performing in total - I need to see the statistics per request, and separately for each kind of request.

epicmonkey commented 9 years ago

Personally, I do not know any other tools other than faina. Though my feelings are it could be extracted from the application to express middleware (./lib folder or whatever).

epicmonkey commented 9 years ago

Ultimately, we must not confuse two things: 1) log/monitor queries (application), and 2) analyze performance on top of it (middleware).

yole commented 9 years ago

If you prefer, I can extract the logic to a more isolated component.

epicmonkey commented 9 years ago

That would be fantastic! BTW, I may be wrong when I said that "performance" is going to be a middleware. Up to you though.