Miniprofiler 监控ef执行详解
首先NuGet添加 相对应ef版本的Miniprofiler.ef引用
web.config文件中添加
<system.webServer>
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>
Global 文件中添加
protected void Application_Start(object sender, EventArgs e)
{
StackExchange.Profiling.EntityFramework6.MiniProfilerEF6.Initialize();
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
if (Request.IsLocal)
{
MiniProfiler.Start();
}
}
protected void Application_EndRequest(object sender, EventArgs e)
{
MiniProfiler.Stop();
}
在需要监控的webfrom页面中增加
protected override void OnPreRender(EventArgs e)
{
Response.Write(StackExchange.Profiling.MiniProfiler.RenderIncludes());
base.OnPreRender(e);
}
运行页面
点击share 查看详细信息
以上就是MiniProfiler 监控webfrom中使用ef操作过程。
最新文章
- [C#6] 5-自动属性增强
- SqlServer环境配置和卸载
- Javascript写俄罗斯方块游戏
- meeting room I &; II
- [javaSE] 练习队列线程和对象序列化
- 关于Block Formatting Context--BFC和IE的hasLayout
- POS机刷卡失败的郁闷事
- Android——获取网络图片
- How to: Reading an ini config file from a batch file
- Bag of Words/Bag of Features的Matlab源码发布
- FTP服务添加用户及设置权限
- Oracle客户端安装教程
- android 调用 screenrecord 实现录屏
- linux设置环境变量(这里以hive为例给大家举例)
- SQLite multiple threads
- (1.5)MySQL表的5种分区类型
- dedecms(织梦系统)如何更新手机版首页模板文件
- overflow visibility opacity(透明度) vertical-align 等等
- java go
- TQ2440开发板挂载U盘出现乱码