How to display timeline information for routines used by controllers in glimpse / Asp.NET MVC

I am currently using Asp.Net MVC 4, and I would like to enable the time of some routines used by my controllers in the glimpse timeline tab.

I know that I need to create an implementation of ITimeLineMessage and send time information using a message broker. But how to create ITimeLineMessage?

+4
source share
3 answers

Here is the way, but its not very nice and not supported:

  • Get MessageBroker for the following static method:
    • Glimpse.Core.Framework.GlimpseConfiguration.GetConfiguredMessageBroker()
  • Then post the ITimelineMessage message to MessageBroker:
    • messageBroker.Publish(timelineMessage)
    • Note: you can create a generic message type that you use again that implements ITimelineMessage
  • To fill in the properties of your ITimelineMessage implementation, you may also need IExecutionTimer . You can get this through the following static method:
    • Glimpse.Core.Framework.GlimpseConfiguration.GetConfiguredTimerStrategy()
    • The above will have an idea of โ€‹โ€‹when the request started for offsets, etc.

As @ nikmd23 said, we know that this is about as bad as what you could ever do, but v2 will see a much easier way to do this.

+3
source

Here is an implementation using Anthonyv's suggestion:

https://gist.github.com/droyad/8292852

+4
source

You can create any custom class that you need, this class must implement ITimelineMessage .

As a general heads-up, we are currently working to make this method easier . If you are interested in the approach you described, please provide your feedback.

0
source

Source: https://habr.com/ru/post/1501484/


All Articles