<div>FWIW: We tag each application-level request with a "what" and "when" and pass this record along to other parts of the system. When the application gets back its reply, it computes statistics. This allows us to track messages that take surprisingly long time -- typically based on some external dependency -- and alert on how many they are, and get some coarse-level statistics.</div>
<div> </div><div>The most fun is when the request enters through one node, but finishes/exits through another node, because the clocks are not 100% in sync, so we sometimes end up with messages taking negative time. The fix for that is to also tag the "source node" in the per-request record that we carry along, and finish off by forwarding that record back to the creator for measurement.</div>
<div> </div><div>Sincerely,</div><div> </div><div>jw<br clear="all"><br>--<br>Americans might object: there is no way we would sacrifice our living standards for the benefit of people in the rest of the world. Nevertheless, whether we get there willingly or not, we shall soon have lower consumption rates, because our present rates are unsustainable. <br>
<br>
<br><br></div><div class="gmail_quote">On Tue, Jul 26, 2011 at 3:14 PM, Jesper Louis Andersen <span dir="ltr"><<a href="mailto:jesper.louis.andersen@gmail.com">jesper.louis.andersen@gmail.com</a>></span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote"><div class="im">On Tue, Jul 26, 2011 at 22:51, Joel Reymont <<a href="mailto:joelr1@gmail.com">joelr1@gmail.com</a>> wrote:<br>

><br>
> On Jul 26, 2011, at 9:23 PM, Jesper Louis Andersen wrote:<br>
><br>
>> Add a flag to erlang:trace/3 such that we can trace a function based upon a<br>
>> sampling value. For instance, that 1/8192 messages on average is<br>
>> traced. Together with call/return we now know how much time was spent<br>
>> in that function as a whole.<br>
><br>
> There may be message passing along the request path, processes talking to one another.<br>
><br>
> You want to capture and time this interaction.<br>
<br>
</div>Ah yes, that is something I completely missed. Indeed you want to<br>
trace along messages also, but that makes it less obvious what to do.<br>
I am more for capturing such instrumentation information on a random<br>
sampling basis. You could do it manually though by inserting<br>
instrumentation functions along the path and then use those functions<br>
as hooks for a unique tag. That is probably what I'd do today if I<br>
needed this. Then I'd trace the instrumentation functions at random<br>
intervals.<br>
<br>
--<br>
<font color="#888888">J.<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br>