EFProfiler
1.0.0
エンティティフレームワークプロファイラー(efprofiler)は、遅いクエリを見つけるためのツールです
pm> Install-Package EFProfiler
Nugetでパッケージページを表示することもできます。
この構成をappsetting.jsファイルに追加する必要があります。
"EFProfilerSetting": {
"MaxMillisecond": 100,
"Path": "wwwroot\LogFile\",
"ActiveLog": true,
"EFProfilerUIOptions": {
"RoutePrefix": "efprofiler",
"DocumentTitle": "EFProfiler UI",
"HeadContent": "EFProfiler",
"Authorization": {
"Roles": "admin",
"Users": ""
}
}
}
必要なサービススタートアップクラスを以下に追加します。
services.AddDbContext(options =>
{
options.UseSqlServer(_configuration.GetConnectionString("DataContext"));
options.AddInterceptors(_configuration);
});
ログを表示するには:
app.EFProfilerUI(_configuration);
ダッシュボード認証の構成:
app.UseAuthentication();
app.UseAuthorization();
app.EFProfilerUI(_configuration);
次に、ブラウザに次のアドレスを入力します。
https://{sitename}/efprofiler/index.html