What I'd do is snapshot the time, down to the millisecond, on both servers, both before and after the message goes through the pipeline (to verify that they didn't drift apart or closer during the message sending event). Then timestamp the message and use the time delta between the two servers to adjust the message sent and receive timestamps to figure out the true time it took to send the message.<div><br></div><div>-- Eric<br><br>On Saturday, December 22, 2012 11:01:34 PM UTC-5, dbu...@peopleanswers.com wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Firstly, kudos to the RabbitMQ team for an astonishingly good product. We are using it as the messaging bus backbone for our flagship application and have had literally zero problems with it. Can't say enough good things.<div><br></div><div>I'm hoping someone can help me figure out a solution for this. When we send a message, it generally goes through a pipeline something like this:</div><div><br></div><div>1. (Sending JVM) A Java thread will push the message into a ThreadPoolExecutor queue.</div><div>2.&nbsp;(Sending JVM)&nbsp;The ThreadPoolExecutor sends the message to RabbitMQ.</div><div>3. RabbitMQ delivers the message to the consumer.</div><div>4. (Receiving JVM) The consumer receives the message and pushes it into a ThreadPoolExecutor queue</div><div>5. (Receiving JVM) The ThreadPoolExecutor handles the message</div><div><br></div><div>My goal is to measure the total time spent, per message, with millisecond accuracy, from one end of this pipeline to the other. I want to be able to calculate this for every message sent through our message bus, so then I can do analysis on those times, in real-time, and draw useful conclusions.</div><div><br></div><div>The trouble is that the part pre-RabbitMQ (1-2) could be in a different JVM on a different physical server than the part post-RabbitMQ (4-5). So I can measure the time for steps 1, 2, 4, and 5. But how do I measure the time it took for the message to actually travel through RabbitMQ (step 3)?</div><div><br></div><div>I can't just time-stamp the message because the local time on the two physical servers cannot be guaranteed to be synchronized to the millisecond. We use NTP but it does not keep the two servers that closely synchronized.</div><div><br></div><div>So my question is: does RabbitMQ offer anything I can use that will allow me to figure out how long step 4 took for each message I send through RabbitMQ, or at least approximate it closely? Or is there some other clever technoloogy I could use to accomplish the same thing?</div><div><br></div><div>Thanks in advance,</div><div>Darrell Burgan<br></div></blockquote></div>