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

六月ゝ 毕业季﹏ 提交于 2019-12-01 08:28:06

Here is a way but its not very nice and not supported:

  • Retrieve the MessageBroker for the following static method:
    • Glimpse.Core.Framework.GlimpseConfiguration.GetConfiguredMessageBroker()
  • Then publish an ITimelineMessage to the MessageBroker:
    • messageBroker.Publish(timelineMessage)
    • Note, you could create a generic message type that you use over again that implements ITimelineMessage
  • To populate the properties of your ITimelineMessage implementation you might also need IExecutionTimer. You can get this via the following static method:
    • Glimpse.Core.Framework.GlimpseConfiguration.GetConfiguredTimerStrategy()
    • The above will have the knowledge of when the request started for offsets etc.

As @nikmd23 said, we know this is about as bad as what you could ever want to do but v2 will see a much much more simple way of doing this.

Here is an implementation using anthonyv's suggestion:

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

You can create any custom class you want, that class just has to implement ITimelineMessage.

As a general heads up, we are currently working through a way to make this WAY easier. If the approach described there interests you, please do provide your feedback.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!