这篇文章介绍了3个工具
•dotnet-counters: 实时统计runtime的状况, 包括 CPU、内存、GC、异常等
•dotnet-trace: 类似性能探测器
•dotnet-dump: 程序崩溃时使用该工具
这次使用的是dotnet-dump, 即使程序没有崩溃, 也可以dump程序快照, 用于分析
实验环境
ubuntu-16.04.5-desktop-amd64
SDK 3.0.100-preview6-012264
1. 新建一个简单Console程序(只能是 .net core 3.0的程序, 不支持 .net core 2.2), 模拟CPU占用100%的情况
1 2 |
|
编辑Program.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
2. 安装dotnet-dump
dotnet tool install --global dotnet-dump --version 1.0.4-preview6.19311.1
提示
If you are using bash, you can add it to your profile by running the following command: