Beispiel #1
0
 private static void DoComputerScienceHomework(TimeSpan forHowLong)
 {
     //Track work as span
     SimpleTracer.TrackWork("Do Computer Science Homework", () =>
     {
         SimpleTracer.CurrentSpan(s => s.WithAttribute("Method", "DoComputerScienceHomework"));
         Thread.Sleep(forHowLong);
     });
 }
Beispiel #2
0
 /// <summary>
 /// This method introduces a delay that is not tracked by a span.
 /// Its time would be accounted for in the caller's span.
 /// </summary>
 /// <param name="forHowLong"></param>
 private static void TakeABreak(TimeSpan forHowLong)
 {
     SimpleTracer.CurrentSpan((s) => { s.WithAttribute("Length of Break", forHowLong.TotalSeconds); });
     Thread.Sleep(forHowLong);
 }