Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Let the mvc-mini-profiler ignore Glimpse requests

I'm using mvc-mini-profiler along with Glimpse. The problem is glimse is flooding the profiler output with glimpse requests. Is there any way to ignore all request made by glimpse ?

like image 405
user256034 Avatar asked Aug 08 '11 19:08

user256034


People also ask

What is the use of MiniProfiler in MVC?

We have been using MiniProfiler in MVC projects to detect the performance of the queries called in the server. The number of requests made by the browser to the server, the response time and many other options a developer would get using these extensions. Glimpse is a new platform for developers to judge their applications.

What is glimpse in ASP NET MVC?

In this article, we will be using ASP.Net MVC for demonstrating the Glimpse usage. Glimpse is just like Chrome developer tool/Firebug for our server. The dictionary** definition of Glimpse is that it is a momentary or partial view, thus it gives us a glimpse at the inner workings of ASP.Net applications.

How do I install glimpse mvc5 and EF6 modules?

The following commands install Glimpse MVC5 and EF6 modules from the package manager console: Navigate to http://localhost:<port #>/glimpse.axd and click the Turn Glimpse On button. If you have your favorites bar displayed, you can drag and drop the Glimpse buttons and add them as bookmarklets:

What are the options in <mini-profiler> tag helper?

Note: <mini-profiler> has many options like max-traces, position, color-scheme, nonce, etc. You can find them in code here. Note #2: The above tag helper registration may go away in future versions of ASP.NET Core, they’re working on smoother alternatives here.


2 Answers

protected void Application_Start()
{
    var ignored = MiniProfiler.Settings.IgnoredPaths.ToList();
    ignored.Add("Glimpse.axd");
    MiniProfiler.Settings.IgnoredPaths = ignored.ToArray();
}

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

like image 176
Frootboots Avatar answered Oct 17 '22 13:10

Frootboots


At the moment Glimpse will make Ajax requests if you have the Remote tab selected or when ever an Ajax request is made by your site.

This is done because when we detect that a request is made we proactively get the Glimpse data. We could probably switch this in a future release to be more lazy and only fetch the data on request.

Note, even though this will help, Glimpse will still be calling back to the server in the same way that Mini Profile does. Hence, both frameworks could probably try and ignore each other for ajax requests.

Hope this helps.

like image 3
anthonyv Avatar answered Oct 17 '22 12:10

anthonyv