MVCMiniProfiler 簡介

來源:互聯網
上載者:User

MVC MiniProfiler是Stack Overflow團隊設計的一款對ASP.NET MVC的效能分析的小程式。可以對一個頁面本身,及該頁面通過直接引用、Ajax、Iframe形式訪問的其它頁面進行監控,監控內容包括資料庫內容,並可以顯示資料庫訪問的SQL(支援EF、EF CodeFirst等 )。並且以很友好的方式展現在頁面上。

可以通過NuGet進行安裝

配置及使用可以看這裡:http://code.google.com/p/mvc-mini-profiler/

其它技巧:

Application_Start中設定

更改profiler產生檔案的路徑 ,包括js及相應產生的資料檔案

   1: MiniProfiler.Settings.RouteBasePath = "~/scripts";  

忽略監控的路徑(如果不保留原預設值也可以不Union)

   1: MiniProfiler.Settings.IgnoredPaths = 

   2:     new[] { "/style/", "/images/","/Menu/","/menu/" }

   3:     .Union(MiniProfiler.Settings.IgnoredPaths)

   4:     .ToArray();

格式化SQL模式

   1: MiniProfiler.Settings.SqlFormatter = new MvcMiniProfiler.SqlFormatters.InlineFormatter();

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.