mvc-mini-profiler

How to configure mvc mini profiler with Linq to SQL?

江枫思渺然 提交于 2019-11-29 11:05:15
I have configured mini profiler with asp.net mvc application. I also want to profile my db so I hooked it with L2S datacontext as in this example . It is working fine for some queries but on other queries I find null reference exception. When I attached the source code to debug I found out that internal void AddSqlTiming(SqlTiming stats) { Head.AddSqlTiming(stats); } Head Property in above method is null in MiniProfiler.cs at line 198. Any idea why? EDIT: Following method returns me the datacontext object public static EvoletDataContext Get() { var connection = ProfiledDbConnection.Get(new

Getting MVC mini-profiler timings into async tasks

痴心易碎 提交于 2019-11-29 09:32:15
问题 I have a long running SQL query inside a page that I've sped up by using an async task: using System.Threading.Tasks; ... var asyncTask = new Task<ResultClass>( () => { using (var stepAsync = MiniProfiler.Current.Step("Async!")) { // exec long running SQL } }); asyncTask.Start(); // do lots of other slow stuff ResultClass result; using (var stepWait = MiniProfiler.Current.Step("Wait for Async")) { result = asyncTask.Result; } (Note that this syntax will be a lot nicer once C# 5 comes out with

Using MiniProfiler with MVC 5

只愿长相守 提交于 2019-11-29 06:28:48
问题 Edit Got the answer here So I wanted to check out MiniProfiler to troubleshoot some performance issues. Before using it on production code I wanted to try it out with the a sample so went ahead with creating a MVC 5 application. This is plain vanilla app that gets created with the template. Added this code in the Index() method of HomeController: var profiler = MiniProfiler.Current; using (profiler.Step("Set page title")) { ViewBag.Title = "Home Page"; } using (profiler.Step("Doing complex

Using Mini-Profilier with EF 4.3 & MVC 4 without creating the database

倾然丶 夕夏残阳落幕 提交于 2019-11-29 01:55:28
问题 I have an issue where we are using EF 4.3 Code First against an existing database. I want to use the Mini-Profiler with EF and call MvcMiniProfiler.MiniProfilerEF.Initialize(); However, since we don't actually create any of the tables, the dbo.__MigrationHistory and dbo.EdmMetadata tables do not exist. The profiler ends up crashing because they don't exist. Is there any way to make the profiler ignore these EF Code First specific tables? Thanks! EDIT: These are the exceptions I get: (They

MiniProfiler with EF “model first” edmx model

两盒软妹~` 提交于 2019-11-29 00:53:18
问题 I'm trying to get MiniProfiler to profile my database access but I'm running into problems. All the help I see out there seems to be for "code first" entity framework connections. My model was designed before the code first update was available this year and I used the designer to create the edmx model. (I've been using this for almost a year and it seems to be working for me) The example on the MiniProfiler documentation site doesn't make sense to me. I've tried a few variations of it but I

Miniprofiler for ASP.NET web site

不打扰是莪最后的温柔 提交于 2019-11-28 23:40:15
How can I use miniprofiler in asp.net web site(NOT FOR MVC)? There are many resources for MVC but I can not find anything for web site. Thanks to Alex. Now it works for asp.net web site. But I can not understand what it displays. I have not written any code in method. See the image below. Code is as below for which I ran profiler. protected void Page_Load(object sender, EventArgs e) { using (MiniProfiler.Current.Step("test")) { Page.Title = "12345"; } } From the miniprofiler.com : PM> Install-Package MiniProfiler in your global.asax : using StackExchange.Profiling; ... protected void

MiniProfiler not showing up on asp.net MVC

萝らか妹 提交于 2019-11-28 20:25:20
I added this to my Global.asax.cs: protected void Application_BeginRequest() { if (Request.IsLocal) { MiniProfiler.Start(); } } protected void Application_EndRequest() { MiniProfiler.Stop(); } I added @MiniProfiler.RenderIncludes() just below the </body> tag in _Layout.cshtml. In my controller I'm using: public class HomeController : Controller { public ActionResult Index() { var profiler = MiniProfiler.Current; // it's ok if this is null using (profiler.Step("Set page title")) { ViewBag.Title = "Home Page"; } using (profiler.Step("Doing complex stuff")) { using (profiler.Step("Step A")) { //

Mini MVC profiler: appears to be displaying profile times for every static resource

蹲街弑〆低调 提交于 2019-11-28 19:12:49
I've just started using the mvc-mini-profiler ( http://code.google.com/p/mvc-mini-profiler/ ) and I think it's awesome. However, I'm getting some odd behaviour while using it. I've got an ASP.NET Webforms site running on IIS7.5 and for some reason when I load a page with the profiler enabled, I not only get a time measurement for the aspx page, but I also get it for random css and js resources on the page. The aspx profile works correctly, with the SQL query also being profiled correctly. However, as the picture shows I also get a bunch of other results which appear to be results for static

Running MiniProfiler with runAllManagedModulesForAllRequests set to false

半城伤御伤魂 提交于 2019-11-28 16:49:18
Recently we upgraded to MiniProfiler version 2.0.1 from v1.7, and since then we have not been able to use it in our MVC3 website because when it tries to get its resources, it instead gets a 404. An example resource call is: /mini-profiler-resources/includes.js?v=tNlJPuyuHLy/d5LQjyDuRbWKa0weCpmO3xkO6MH4TtA= In searching around, most people are suggesting that simply setting runAllManagedModulesForAllRequests should be set to true . For giggles, I went ahead and set it to true, and yes it did work. But that is not an acceptable answer. How can I keep runAllManagedModulesForAllRequests=false and

How can I make the ASP.NET MVC mini profiler work with Linq 2 SQL?

淺唱寂寞╮ 提交于 2019-11-28 08:19:48
The ASP.NET MVC Mini Profiler looks awesome, but I don't get the Linq 2 SQL usage example. This is the Linq2SQL example from the profiler documentation: partial class DBContext { public static DBContext Get() { var conn = ProfiledDbConnection.Get(GetConnection()); return new DBContext(conn); // or: return DataContextUtils.CreateDataContext<DBContext>(conn); } } How do I use this in my actual application? I would have expected some kind of wrapper around my DataContext, but this seems to work in a different way. I don't even know where that that "GetConnection()" method from the example is