Miniprofiler在普通net项目中的使用
2016-03-14 10:28
330 查看
1、Global.asax中配置
2、 在页面的最底部可以输出用于在页面呈现结果的html标签
StackExchange.Profiling.MiniProfiler.RenderIncludes().ToHtmlString();
3、监控sql语句的运行时间
问题:返回的是dbconnection类型,无法强制转换为sqlconnection
4、Web.config文件中插入配置
5、Miniprofiler配置
问题1:Iis6中,加入miniprofiler,js文件显示404错误
问题2:左下角的m和c不显示
在iis7,应用连接池 > 高级设置 > 启用32位应用程序 > false
问题3:如何快速隐藏miniprofiler的左上角提示
Alt + p
参考资料
官网的使用说明: http://miniprofiler.com/
Void Application_BeginRequest(Object sender, EventArgs e){ If(Request.IsLocal){ //请求来自本地计算机 StatckExchange.Profiling.MiniProfiler.Start(); } } Void Application_EndRequest(Object sender, EventArgs e){ StackExchange.Profiling.MiniProfiler.Stop(); }
2、 在页面的最底部可以输出用于在页面呈现结果的html标签
StackExchange.Profiling.MiniProfiler.RenderIncludes().ToHtmlString();
3、监控sql语句的运行时间
Var conn = new SqlConnection(“”); If(MiniProfiler.Current == null) return conn; Return new StackExchange.Profiling.Data.ProfiledDbConnection(conn, MiniProfiler.Current);
问题:返回的是dbconnection类型,无法强制转换为sqlconnection
4、Web.config文件中插入配置
<system.webServer> ... <handlers> <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" /> </handlers> <moudles runAllManagedModulesForAllRequests=”true” /> </system.webServer>
5、Miniprofiler配置
MiniProfiler.Settings.PopupRenderPosition = RenderPosition.Right; // 提示条靠右显示 MiniProfiler.Settings.ShowControls = true; // 提示条上显示“m”和“c” MiniProfiler.Settings.IgnoredPaths = new string[] { ".png", "/img/", "/js/" };// url请求中如果包含其中的内容,将不被监控
问题1:Iis6中,加入miniprofiler,js文件显示404错误
问题2:左下角的m和c不显示
在iis7,应用连接池 > 高级设置 > 启用32位应用程序 > false
问题3:如何快速隐藏miniprofiler的左上角提示
Alt + p
参考资料
官网的使用说明: http://miniprofiler.com/
相关文章推荐
- 提高php编程效率的小结
- 初次使用JFinal
- 3月初全球域名商(国际域名)注册保有量及份额TOP21
- Gradle依赖的统一管理
- swift 设置navigationBar的背景颜色和字体颜色
- 持久化存储
- 234. Palindrome Linked List
- .bat文件的编写和运行
- 在windows下将Nginx添加为系统服务
- Android设备抓包命令
- Java并发编程:volatile关键字解析
- linux系统优化
- 多目标跟踪算法
- Android中JNI起源及存在的必要性
- ios app 实现热更新(无需发新版本实现app添加新功能)
- imx6的IOMUX配置方法
- MyEclipse内存参数配置“ -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M ”的含义
- iOS获取设备型号、装置类型等信息
- HDU 5297 Y sequence 容斥 迭代
- java学习笔记(一)