protected void WriteTimelineMessageCore(ITimelineMessage timelineMessage) { var timerResult = _timer.Stop(_offset); var message = timelineMessage .AsTimelineMessage(EventName, CategoryItem) .AsTimedMessage(timerResult); _messageBroker.Publish(message); }
protected void PublishTimingMessage(TimerResult timed, ITimelineMessage message, ITabSetupContext context) { context.MessageBroker.Publish(new StatsdNetMessage() { Id = Guid.NewGuid(), EventName = "GlimpseStatsdNetTiming: " + message.EventName, EventCategory = new TimelineCategoryItem("StatsdNet", "black", "grey") }.AsTimedMessage(timed)); }
protected TimerResult InitializeTimer(ITimelineMessage message) { var timer = new TimerResult(); timer.StartTime = DateTime.Now; timer.Offset = message.Offset + (timer.StartTime.Subtract(message.StartTime)); return(timer); }
internal static OngoingCapture Capture(string eventName, string eventSubText, TimelineCategoryItem category, ITimelineMessage message) { if (string.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } #pragma warning disable 618 var executionTimer = GlimpseConfiguration.GetConfiguredTimerStrategy()(); var messageBroker = GlimpseConfiguration.GetConfiguredMessageBroker(); #pragma warning restore 618 if (executionTimer == null || messageBroker == null) { return OngoingCapture.Empty(); } return new OngoingCapture(executionTimer, messageBroker, eventName, eventSubText, category, message); }
internal static OngoingCapture Capture(string eventName, TimelineCategoryItem category, ITimelineMessage message) { return(Capture(eventName, null, category, message)); }
public OngoingCapture(IExecutionTimer executionTimer, IMessageBroker messageBroker, string eventName, string eventSubText, TimelineCategoryItem category, ITimelineMessage message) { Offset = executionTimer.Start(); ExecutionTimer = executionTimer; Message = message.AsTimelineMessage(eventName, category, eventSubText); MessageBroker = messageBroker; }
internal static void CaptureMoment(string eventName, string eventSubText, TimelineCategoryItem category, ITimelineMessage message) { if (string.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } #pragma warning disable 618 var executionTimer = GlimpseConfiguration.GetConfiguredTimerStrategy()(); var messageBroker = GlimpseConfiguration.GetConfiguredMessageBroker(); #pragma warning restore 618 if (executionTimer == null || messageBroker == null) { return; } message .AsTimelineMessage(eventName, category, eventSubText) .AsTimedMessage(executionTimer.Point()); messageBroker.Publish(message); }
internal static void CaptureMoment(string eventName, ITimelineMessage message) { CaptureMoment(eventName, null, DefaultCategory, message); }
internal static void CaptureMoment(string eventName, TimelineCategoryItem category, ITimelineMessage message) { CaptureMoment(eventName, null, category, message); }
internal static OngoingCapture Capture(string eventName, TimelineCategoryItem category, ITimelineMessage message) { return Capture(eventName, null, category, message); }
internal static OngoingCapture Capture(string eventName, ITimelineMessage message) { return Capture(eventName, null, DefaultCategory, message); }
internal static OngoingCapture Capture(string eventName, ITimelineMessage message) { return(Capture(eventName, null, DefaultCategory, message)); }
internal static OngoingCapture Capture(string eventName, string eventSubText, TimelineCategoryItem category, ITimelineMessage message) { if (string.IsNullOrEmpty(eventName)) { throw new ArgumentNullException("eventName"); } #pragma warning disable 618 var executionTimer = GlimpseConfiguration.GetConfiguredTimerStrategy()(); var messageBroker = GlimpseConfiguration.GetConfiguredMessageBroker(); #pragma warning restore 618 if (executionTimer == null || messageBroker == null) { return(OngoingCapture.Empty()); } return(new OngoingCapture(executionTimer, messageBroker, eventName, eventSubText, category, message)); }