racker/node-tryfer — pull request #6 by Kami (2012-11-12 03:36:38+00:00)
Title: Restkin backend batch send support

Currently RESTkin tracer sends a trace to the backend using a POST HTTP request every time an end of the trace is detected.

This is inefficient and could easily result in many outgoing requests when instrumenting a typical web application.

This branch adds support for batch send mode. When batch send mode is enabled, messages (traces) are queued internally and only sent once one of the following conditions are meant:

1. Number of batched messages is larger than the `batchSendAfterMsgs` value.
2. More than `batchSendAfterInterval` milliseconds have passed between the time last batch has been sent to the backend and the time of the last queued message.