My app as an API which I have no control of. I don't know which users use it, how many times, etc.
What's the best way of doing an analytics system to keep track of my API usage?
Than开发者_Python百科ks!
Setup a fast database like Redis, then start doing simple request tracking. Improve on that.
You could use harmony proxies to wrap all of your API objects to do some generic stats tracking by creating a general purpose proxy that intercepts function calls and forwards them to your actual api after recording the information that you need.
https://github.com/isaacs/node-proxy/
http://wiki.ecmascript.org/doku.php?id=harmony:proxies
精彩评论