1.安装MiniProfiler包

PM> Install-Package MiniProfiler

2.在Views下的web.config中引入命名空间:

    <pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="StackExchange.Profiling" />
......
</namespaces>
</pages>

3.在_Layout</body>前加入:

@MiniProfiler.RenderIncludes();

4.在Global.asax中加入:

protected void Application_BeginRequest()
{
if (Request.IsLocal) { MiniProfiler.Start(); } //or any number of other checks, up to you
} protected void Application_EndRequest()
{
MiniProfiler.Stop(); //stop as early as you can, even earlier with MvcMiniProfiler.MiniProfiler.Stop(discardResults: true);
}

5.在web.config中加入(如果MiniProfiler不展示任何信息):

<system.webServer>
...
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>

demo

MiniProfiler的更多相关文章

  1. 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)

    前言 Entity Framework 延伸系列目录 今天来说说EF与MVC项目的性能检测和监控 首先,先介绍一下今天我们使用的工具吧. MiniProfiler~ 这个东西的介绍如下: MVC Mi ...

  2. MiniProfiler(MiniProfiler.EF6监控调试MVC5和EF6的性能)

    git:  https://github.com/MiniProfiler 以前开发Webform的时候可以开启trace来跟踪页面事件,这对于诊断程序的性能是有很大的帮助的,起到事半功倍的作用,今天 ...

  3. miniprofiler对方法的时间性能检测

    miniprofiler对方法的时间性能检测 直接上代码 using StackExchange.Profiling; ... var profiler = MiniProfiler.Current; ...

  4. miniprofiler的对数据库的监测使用。以nancy,petapoco为例

    miniprofiler的使用 miniprofiler的详细介绍请看这里http://miniprofiler.com/.(可以对数据库和页面等监控如 ado ef mvc mongodb) 本文以 ...

  5. petapoco 使用 MiniProfiler Glimpse监控

    PetaPoco是一款适用于.Net(window) 和Mono( linux )的微小.快速.单文件的微型ORM. MVC MiniProfiler是Stack Overflow团队设计的一款对AS ...

  6. 使用MiniProfiler跟踪MVC + EF + Bootstrap 2 权限管理系统的性能消耗

    安装MiniProfiler 在MVC + EF + Bootstrap 2 权限管理系统入门级(附源码)文章中下载了它的源码,调试模式下打开一个页面都要再2.5秒以上,所以使用MiniProfile ...

  7. 使用MiniProfiler给Asp.net MVC和Entity Framework号脉(附源码)

    在学习python开发框架pylons/pyramid的过程中,里面有个非常棒的页面性能监控功能,这样在开发过程中,你能清楚的知道当前页面的性能以及其它参数. 这里介绍一下如何给Asp.net MVC ...

  8. MiniProfiler 兼容 Entity Framework 6

    一直以来都是在用MiniProfiler配合ASP.NET MVC做请求的监控. 在某项目升级Entity Framework 6之后,在执行查询时报错误: --------------无法将类型为“ ...

  9. 性能工具MiniProfiler在Asp.Net WebForm跟踪EntityFramework

    http://www.xuebuyuan.com/356638.html 选择MiniProfiler.EF 默认会把MiniProfiler安装上,笔者程序是Asp.Net WebForm 不需要安 ...

随机推荐

  1. POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法

    Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Descr ...

  2. HDOJ 1051. Wooden Sticks 贪心 结构体排序

    Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) To ...

  3. POJ 2255. Tree Recovery

    Tree Recovery Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11939   Accepted: 7493 De ...

  4. ASP.NET之纠错

    甘特图是:计划项目的时间安排和资源平衡 IoC容器会自动判断javabean和某些数据类型是否建立起依赖关系(装配是否成功),主要用在自动装配中. 通过设置属性<bean id="&q ...

  5. 第一个C语言的小项目

    这里先写下主要的业务代码,一些库代码稍后补充上 /** * Feed新闻个性化推送 */ #include "push_service_news.h" /** * 保证单进程运行 ...

  6. Qt 开启鼠标跟踪,自动激活mouseMoveEvent的问题

    最近在Qt上实现一个功能,鼠标在图片上移动,触发mouseMoveEvent事件,进而生成一个小的半透明窗口,放大显示以鼠标为中心的一个区域的图像并随鼠标移动.但是,必须鼠标摁下,才触发mouseMo ...

  7. [LeetCode] Contains Duplicate 包含重复值

    Given an array of integers, find if the array contains any duplicates. Your function should return t ...

  8. [LeetCode] Binary Tree Zigzag Level Order Traversal 二叉树的之字形层序遍历

    Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to ...

  9. 自动判断应该Ajax还是return

    起因 最近回顾以前的代码,发现一个偶尔会见到的现象.一个类里面的方法可能需要Ajax返回,也有可能需要函数return.这个现象发生在网站MVC中的 逻辑层(或模型层),示例如下.IndexCtrl是 ...

  10. QPS 与 TPS 简介

    QPS:Queries Per Second意思是"每秒查询率",是一台服务器每秒能够相应的查询次数,是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准. TPS是Tra ...