Mini-Profiler添加外部时序

时间:2012-09-28 07:51:45

标签: mvc-mini-profiler

我正在使用MVC 3应用程序,该应用程序使用包含响应中的计时的业务逻辑。 现在我想在特定级别的MVC3应用程序中将这些时序添加到Mini-Profiler中。

我试过这样的话:

profiler.StepStart("key", "value");
var response = GetXXXResponse(request);
if (response != null && response.Timings)
{
    foreach (var child in response.Timings)
    {
         var profiler = new MiniProfiler(child.Name, _profilerService.Profiler.Level;
          profiler.ClientTimings = new ClientTimings { Timings = new List<ClientTimings.ClientTiming> { new ClientTimings.ClientTiming { Duration = child.ResponseTime, Name = child.Name, Start = 0 } } };
           _profilerService.Profiler.AddProfilerResults(profiler);
     }
}
profiler.StepStop("key");

我正在使用Mini-Profiler 2.0.2版,在UI中我看到了添加的步骤,但时间不正确。 如何在MVC中配置特定功能,并为外部进程提供的无法更改的块添加额外的时序信息?

0 个答案:

没有答案
相关问题