把旧系统迁移到.Net Core 2.0 日记 (20) --使用MiniProfiler for .NET
2024-08-25 10:35:15
要查看页面耗时,EFCore的性能.
Install-Package MiniProfiler.AspNetCore.Mvc
编辑Startup.cs
public void ConfigureServices(IServiceCollection services)
{
//EFCore性能监控
services.AddMiniProfiler().AddEntityFramework();
...
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache)
{ app.UseMiniProfiler(); // The call to app.UseMiniProfiler must come before the call to app.UseMvc
app.UseMvc(routes =>
{
// ...
});
}
编辑 _ViewImports.cshtml
:
@using StackExchange.Profiling
@addTagHelper *, MiniProfiler.AspNetCore.Mvc
Add MiniProfiler to your master layout (Shared/_Layout.cshtml
by default):
<mini-profiler />
最新文章
- http协议
- WinForm------GridControl合并单元格
- PL/SQL异常处理
- UI入门指引
- WPF [调用线程无法访问此对象,因为另一个线程拥有该对象。] 解决方案以及如何实现字体颜色的渐变
- Conntect Bluetooth devices in iOS.
- CORDIC原理与FPGA实现(2)
- 交叉编译php5,、nginx、squid方法
- swift语言实战晋级-第9章 游戏实战-跑酷熊猫-9-10 移除平台与视差滚动
- task-clph
- 转载crontab例行工作调度
- Tomcat源码学习记录--web服务器初步认识
- Collection子接口(List/Set/Queue/SortedSet)
- 安装windows7和ubuntu双系统后引导项设置
- 5)Javascript设计模式:extends模式
- flask_restful 学习笔记
- Android + Eclipse + PhoneGap 环境配置
- power designer 连接mysql提示“connection test failed”
- Centos7中文乱码问题的解决
- Python学生信息管理系统的开发