本文介绍了如何在glimpse/Asp.NET MVC中显示控制器使用的例程的时间线信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在使用Asp.Net MVC 4,我想在瞥见的时间轴"选项卡中包含控制器使用的某些例程的时间.

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

我知道我必须创建一个ITimeLineMessage实现并通过消息代理发送定时信息.但是如何创建ITimeLineMessage呢?

I know that I have to create an ITimeLineMessage Implementation and send the timing information with a message broker. But how to create the ITimeLineMessage ?

推荐答案

这是一种方法,但不是很好,也不支持:

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

  • 为以下静态方法检索MessageBroker:
    • Glimpse.Core.Framework.GlimpseConfiguration.GetConfiguredMessageBroker()
    • Retrieve the MessageBroker for the following static method:
      • Glimpse.Core.Framework.GlimpseConfiguration.GetConfiguredMessageBroker()
      • messageBroker.Publish(timelineMessage)
      • 请注意,您可以创建一个通用消息类型,以供再次使用以实现ITimelineMessage
      • messageBroker.Publish(timelineMessage)
      • Note, you could create a generic message type that you use over again that implements ITimelineMessage
      • Glimpse.Core.Framework.GlimpseConfiguration.GetConfiguredTimerStrategy()
      • 以上内容将了解何时开始请求偏移量等.

      正如@ n​​ikmd23所说,我们知道这和您想做的事情一样糟糕,但是v2会看到更简单的方法.

      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.

      这篇关于如何在glimpse/Asp.NET MVC中显示控制器使用的例程的时间线信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-03 20:37