Exemplo n.º 1
0
        protected void WriteTimelineMessageCore(ITimelineMessage timelineMessage)
        {
            var timerResult = _timer.Stop(_offset);
            var message     = timelineMessage
                              .AsTimelineMessage(EventName, CategoryItem)
                              .AsTimedMessage(timerResult);

            _messageBroker.Publish(message);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 6
0
 internal static OngoingCapture Capture(string eventName, TimelineCategoryItem category, ITimelineMessage message)
 {
     return(Capture(eventName, null, category, message));
 }
Exemplo n.º 7
0
 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;
 }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
 internal static void CaptureMoment(string eventName, ITimelineMessage message)
 {
     CaptureMoment(eventName, null, DefaultCategory, message);
 }
Exemplo n.º 10
0
 internal static void CaptureMoment(string eventName, TimelineCategoryItem category, ITimelineMessage message)
 {
     CaptureMoment(eventName, null, category, message);
 }
Exemplo n.º 11
0
 internal static OngoingCapture Capture(string eventName, TimelineCategoryItem category, ITimelineMessage message)
 {
     return Capture(eventName, null, category, message);
 }
Exemplo n.º 12
0
        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);
        }
Exemplo n.º 13
0
 internal static void CaptureMoment(string eventName, ITimelineMessage message)
 {
     CaptureMoment(eventName, null, DefaultCategory, message);
 }
Exemplo n.º 14
0
 internal static void CaptureMoment(string eventName, TimelineCategoryItem category, ITimelineMessage message)
 {
     CaptureMoment(eventName, null, category, message);
 }
Exemplo n.º 15
0
 internal static OngoingCapture Capture(string eventName, ITimelineMessage message)
 {
     return Capture(eventName, null, DefaultCategory, message);
 }
Exemplo n.º 16
0
 internal static OngoingCapture Capture(string eventName, ITimelineMessage message)
 {
     return(Capture(eventName, null, DefaultCategory, message));
 }
Exemplo n.º 17
0
        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));
        }
Exemplo n.º 18
0
 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;
 }