多看官方文档:!!!!!https://miniprofiler.com/dotnet/AspDotNet
MIniProFiler 3.x的版本!!!!!!!!!!!!!!!!!!
Global.asax中:
protected void Application_BeginRequest()
{
if (Request.IsLocal) // Example of conditional profiling, you could just call MiniProfiler.StartNew();
{
MiniProfiler.Start();
}
}
protected void Application_EndRequest()
{
MiniProfiler.Stop(); // Be sure to stop the profiler!
}
MIniProFiler 4.x的版本!!!!!!!!!!!!!!!
protected void Application_BeginRequest()
{
// You can decide whether to profile here, or it can be done in ActionFilters, etc.
// We're doing it here so profiling happens ASAP to account for as much time as possible.
if (Request.IsLocal) // Example of conditional profiling, you could just call MiniProfiler.StartNew();
{
MiniProfiler.StartNew();// 不再是start和stop
}
}
protected void Application_EndRequest()
{
MiniProfiler.Current?.Stop();
}