Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude a specific service from miniprofiler?

I am using miniprofiler to assess performance of my MVC6 application. Everything is working fine but I am looking for an option to exclude (mute) a particular service (requests) from my application.

For example: My application is polling user authentication every second using some polling service. I don't want to include that in my miniprofiler results. Is there a way to exclude it?

Why I want this? I want to exclude this redundant service, so that I can focus on other results which needs more attention. Also, this polling service is filling fast my results-index page.

like image 285
Vikas Vaidya Avatar asked Oct 18 '25 01:10

Vikas Vaidya


1 Answers

There are several ways to do this, when you are initializing MiniProfiler:

Ignore the path

var ignored = MiniProfiler.Settings.IgnoredPaths.ToList();
ignored.Add("/__browserLink/");
ignored.Add("/path/to/ignore");
MiniProfiler.Settings.IgnoredPaths = ignored.ToArray();

Exclude the Type, Assembly or Method

MiniProfiler.Settings.ExcludeType("SessionFactory"); 
MiniProfiler.Settings.ExcludeAssembly("NHibernate"); 
MiniProfiler.Settings.ExcludeMethod("Flush");   
like image 74
Yaakov Ellis Avatar answered Oct 21 '25 12:10

Yaakov Ellis