欢迎您来到“名字什么都是浮云”的博客空间!

.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网站等监控,需要你自行去测试,本例仅以控制台程序为例。希望本文可以帮到你。

 

posted @   名字什么都是浮云  阅读(738)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
历史上的今天:
2017-03-27 C# 高级编程9 第30章MEF C#可扩展编程之MEF第2章(抄录)
2017-03-27 C# 高级编程9 第30章MEF C#可扩展编程之MEF第一章
2017-03-27 C#中常见的系统内置委托用法详解(抄录)
点击右上角即可分享
微信分享提示