开发者

Node.js: How To Keep Track of My API Usage?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜