.NET性能调试工具-----ANTS Performance Profiler 耗时检测 内存检测 死锁监控
原文:https://www.cnblogs.com/erdao/p/5107754.html
下载ANTS Performance Profiler中文破解版
安装时选择下列四项即可。

安装后,为了测试其作用。
在sqlserver中定义test表,表字段仅id和Name.往表插入100万行数据
declare @name nvarchar(50),@num int=0 while(@num<1000000) begin insert into test(Name) select Name = convert(nvarchar(50),@num)+'叠加' set @num=@num+1 end

编写以下控制台程序,循环100次,每次全量查询test表。等于查询1亿行数据。非常耗时。
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using Test2; using TestCore; namespace Test { class Program { static void Main(string[] args) { for (int i = 0; i < 100; i++) { QueryDB(); } } private static void QueryDB() { var sql = "select * from test"; SqlHelper.ExecuteDataTable(sql, null); } } }
将控制台程序进行生成 test2.exe
运行ANTS Performance Profiler,准备监控耗时代码所在位置。

选择continue即可,因本产品未激活,暂时先试用。

选择文件File,选择控制台程序.NET executable,选择.net 执行路径test2.exe的路径,点击运行

test2.exe开始运行,并进行性能监控
点击Select All下方会展示详细的代码执行信息以及耗时信息

对于服务、iis网站等监控,需要你自行去测试,本例仅以控制台程序为例。希望本文可以帮到你。

浙公网安备 33010602011771号