Skip to content

Entity Framework Profiler (EFProfiler) is a tool for finding slow queries

License

Notifications You must be signed in to change notification settings

mehdimiri/EFProfiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EFProfiler

Entity Framework Profiler (EFProfiler) is a tool for finding slow queries

Install via NuGet

To install EFProfiler, run the following command in Package Manager Console

    pm> Install-Package EFProfiler

You can also view the package page on NuGet.

How to use ?

You should add this configuration in appsetting.js file :


 "EFProfilerSetting": {
    "MaxMillisecond": 100,
    "Path": "wwwroot\\LogFile\\",
    "ActiveLog": true,
    "EFProfilerUIOptions": {
         "RoutePrefix": "efprofiler",
         "DocumentTitle": "EFProfiler UI",
         "HeadContent": "EFProfiler",
         "Authorization": {
            "Roles": "admin",
            "Users": ""
         }
     }
  }

Add required services Startup class as below :


     services.AddDbContext(options =>
            {
                options.UseSqlServer(_configuration.GetConnectionString("DataContext"));
                options.AddInterceptors(_configuration);
            });

To display the logs :


     app.EFProfilerUI(_configuration);

Configuring Dashboard authorization :


    app.UseAuthentication();
    app.UseAuthorization();

    app.EFProfilerUI(_configuration);

Then enter the following address in the browser :


    https://{sitename}/efprofiler/index.html

image

About

Entity Framework Profiler (EFProfiler) is a tool for finding slow queries

Topics

Resources

License

Stars

Watchers

Forks