SlideShare a Scribd company logo
.NET 5とDiagnostics
かめがわ かずし(kkamegawa)
自己紹介
personal:
name: かめがわ かずし
alias: kkamegawa
community:
MVP: Microsoft MVP for Developer Technologies(2009-)
UsersGroup: Team Foundation Server Users Group
URL: https://dev.azure.com/tfsug/tfsuginfo
Blog: はてなブログ
URL: https://kkamegawa.hatenablog.jp
devblog radio: https://devblog.connpass.com/
This contents based on 2020/12/5
.NET 5がリリースされました
たくさんの機能追加 たくさんの性能向上 多少の破壊的変更
.NET(かつての.NET Core)はクロスプラットフォーム
Windowsだけきにしていればいい時代はおしまい
Windows/macOSで作ってLinuxへデプロイ(k8sなど)
クロスプラットフォームでの性能調査大丈夫?
.NET Framework 4.8までのおさらい
System.Diagnostics名前空間
パフォーマンスモニター
PerfView
その他3rd Partyツール
.NET 5では?
dotnet-trace(.NET Core 3.0以降)
dotnet-counter(同上)
Perfview(Windowsのみ)
その他3rd PartyツールやOSのツール
診断用dotnet tools
ツール インストール 概要
dotnet-counters dotnet tool install --global dotnet-
counters
Perfviewやdotnet traceでのパフォーマ
ンスカウンターログ収集用
dotnet-dump dotnet tool install --global dotnet-dump マネージドダンプの分析
dotnet-gcdump dotnet tool install --global dotnet-
gcdump
GCのダンプを取得
dotnet-trace dotnet tool install --global dotnet-trace EventPipeを使ってプロセスの実行ト
レースの収集を実施
dotnet-symbol dotnet tool install --global dotnet-
symbol
ダンプの分析に必要なモジュールと
シンボルのダウンロードを実施
dotnet-sos dotnet tool install --global dotnet-sos ネイティブデバッガーで.NET Coreのシ
ンボルを分析するための拡張機能
Demo
dotnet toolsでのマネージドダンプ取得
dotnet-dump collectで開始
dotnet-dump analyzeで中身見ていく
サブコマンドたくさん
ダンプファイル名
対象プロセスID
正直つらい
デバッグを支援するIDE
Visual Studio(Windows / macOS)
16.9 PreviewではWSL2と統合
プレビュー以前なら.NET Core Debugging with WSL 2 - Preview拡張機能
Visual Studio Code
monoDevelop(Linuxのみバイナリー提供)
https://www.monodevelop.com/
Rider(JetBrains)
https://www.jetbrains.com/ja-jp/rider/
Visual Studioの診断ツール
Visual Studio診断ツール is 便利
プロファイラーより気軽に使えます
実行中のCPUプロファイリング
任意のメモリスナップショット取得
例外のイベント記録
昔プロファイラーって
あったよね?
まだあります(パフォーマンスプロファイラー)
プロファイラーはもっと便利
リリース構成での性能調査
細かい.NETのイベントもとれる
クラウドでもVM(IaaS)ならば使用可能
プロファイラーの使い方
Rider IDE
※:2020/12/5現在
RiderがC# 9.0の構文
に対応してないけど、
コンパイルはもちろん
可能。
Riderでのプロファイリング
サードパーティーの診断ツール(一部)
.NET Memory Profiler(SciTech)
https://memprofiler.com/
dotMemory(JetBrains)
https://www.jetbrains.com/ja-jp/dotmemory/
ANTS Memory Profiler(RedGate)
https://www.red-gate.com/products/dotnet-development/ants-memory-profiler/
.NET Memory Validator(Software Verify)
https://www.softwareverify.com/dotnet-memory.php
.NET Profiler(YourKit)
https://www.yourkit.com/.net/profiler/features/
他Visual Studio Marketplaceにあるもの
https://marketplace.visualstudio.com/search?term=memory&target=VS&categor
y=Tools&vsVersion=&subCategory=All&sortBy=Relevance
プロダクション診断ツールやサービス(一部)
 Stackify
https://stackify.com/
 RevDebug
https://revdebug.com/
 OzCode
https://oz-code.com/
 NewRelic
https://newrelic.co.jp/
 DataDog
https://www.datadoghq.com/ja/
 Application Insights
https://docs.microsoft.com/ja-jp/azure/azure-monitor/app/app-insights-overview
 Mackerel
https://mackerel.io/ja/
 Windows Performance Recorder(Windows付属)
https://docs.microsoft.com/ja-jp/windows-hardware/test/wpt/wpr-quick-start
どれを使えば🤔🤔
結局OSや.NETランタイムから取得するので、採取できる
情報に違いはない
この辺の理由で決めてもいいのでは?
UIが好み
買いやすい
日本語化されている
(日本語の)情報が多い
サポートがある
価格(無料ツールで頑張る、お高いツールで楽をする等)
Linuxでのデバッグ
Visual Studio + Remote Debug(ssh)
WSL2と一緒に
Visual Studio Code(コンテナー用)
Visual Studio 2019 Preview(16.9)
Linuxでのプロファイル
Perfcollect
https://github.com/dotnet/coreclr/blob/master/Documentation/proj
ect-docs/linux-performance-tracing.md
→この方法ではlinux-tools-4.19.128-microsoft-standardがないといわれる
dotnet global toolsで実施
※:結果はWindowsのPerfViewやVSで解析
.NET 5での性能向上
こまごまと頑張ってる
https://devblogs.microsoft.com/dotnet/performance-improvements-
in-net-5/
障害時のトラブルシューティング
正しい情報収集
いつ、どの操作を、だれが、何が起きたか
調査に必要なものはあるか
クラッシュしたら発生時のダンプ
ログ
リリースしたときのソース、シンボル(意外と保存しない)
調査に欠かせないログ保存場所
ファイル
標準出力をリダイレクト
ETW(Event Trace for Windows)
イベントログ
データベース
資料的なURL
RevDebugのチュートリアル
https://revdebug.com/doc/tutorial/5.7.0.0/Getting-Started/Supported-
Technologies/net-core/
クラウドでの診断サンプル
https://github.com/dotnet/samples/tree/master/core/diagnostics/DiagnosticScen
arios
https://docs.microsoft.com/ja-jp/dotnet/architecture/containerized-
lifecycle/design-develop-containerized-apps/build-aspnet-core-applications-linux-
containers-aks-kubernetes
dotnet global Toolsでの診断
https://www.stefangeiger.ch/2020/05/07/dotnet-diagnostics-tools-counters.html

More Related Content

PDF
Azure DevOps入門~TechLab編
PDF
Azure Boards and Azure Test Plans inside out.
PDF
Azure DevOps Management in Organization
PDF
Azure boards for beginners
PDF
DevOps and Compliance and Security
PDF
Azure DevOps Online Vol.3 - Inside Azure Pipelines
PDF
How to create your own Azure Pipeline's image
PDF
Azure DevOps's security
Azure DevOps入門~TechLab編
Azure Boards and Azure Test Plans inside out.
Azure DevOps Management in Organization
Azure boards for beginners
DevOps and Compliance and Security
Azure DevOps Online Vol.3 - Inside Azure Pipelines
How to create your own Azure Pipeline's image
Azure DevOps's security

What's hot (20)

PDF
Deploy Strategy with Azure Pipelines
PPTX
What's new Azure DevOps in //Build 2019
PDF
Getting Start for Azure Pipelines
PPTX
Deploy to Azure by ??? Azure Repos or GitHub
PDF
Introduce TFSUG and Azure DevOps Server 2020
PDF
Azure DevOpsとセキュリティ
PPTX
Visual studioonlineとwebサイトで始めるci/cdの第一歩
PDF
Ignite 2021 振り返り(DevOps)
PDF
Visual studio online and Agile
PDF
「何もしないのにCIが失敗した」を防ぐ
PPTX
Static website + Piplelines
PPTX
Azure DevOps ハンズオン Vo.3 ~Delivery Plans を用いたプロジェクトのスケジュール管理~
PDF
【BS11】毎年訪れる .NET のメジャーバージョンアップに備えるために取り組めること
PDF
PHPerだってサーバーレスしたい!
PDF
[TL10] Azure IaaS 構築・運用・管理の専門家が語る DevTest Labs ~高速・費用無駄ナシ・簡単管理を実現する開発・テスト環境の構築~
PDF
【BS10】Microsoft と GitHub の開発エコシステムで、開発にドライブをかけよう!
PDF
[DO02] Jenkins PipelineとBlue Oceanによる、フルスクラッチからの継続的デリバリ
PDF
【BS7】GitHubをフル活用した開発
PDF
Azure DevOps 関西 2019 - Overview
PPTX
What's Azure DevOps
Deploy Strategy with Azure Pipelines
What's new Azure DevOps in //Build 2019
Getting Start for Azure Pipelines
Deploy to Azure by ??? Azure Repos or GitHub
Introduce TFSUG and Azure DevOps Server 2020
Azure DevOpsとセキュリティ
Visual studioonlineとwebサイトで始めるci/cdの第一歩
Ignite 2021 振り返り(DevOps)
Visual studio online and Agile
「何もしないのにCIが失敗した」を防ぐ
Static website + Piplelines
Azure DevOps ハンズオン Vo.3 ~Delivery Plans を用いたプロジェクトのスケジュール管理~
【BS11】毎年訪れる .NET のメジャーバージョンアップに備えるために取り組めること
PHPerだってサーバーレスしたい!
[TL10] Azure IaaS 構築・運用・管理の専門家が語る DevTest Labs ~高速・費用無駄ナシ・簡単管理を実現する開発・テスト環境の構築~
【BS10】Microsoft と GitHub の開発エコシステムで、開発にドライブをかけよう!
[DO02] Jenkins PipelineとBlue Oceanによる、フルスクラッチからの継続的デリバリ
【BS7】GitHubをフル活用した開発
Azure DevOps 関西 2019 - Overview
What's Azure DevOps
Ad

Similar to NET5 and Diagnostics (20)

PDF
Getting Started .NET Core
PDF
20201127 .NET 5
PDF
.NET Coreから概観する.NETのOSSへの取り組み
PDF
The Twelve-Factor (A|M)pp with C#
PDF
【BS4】時は来たれり。今こそ .NET 6 へ移行する時。
PDF
Ignite 2021秋 recap - 開発者向け新機能紹介
PPTX
Hardware control by .NET Core 3.1
PDF
.NET Coreとツール類の今
PDF
PostgreSQL開発コミュニティに参加しよう! (オープンデベロッパーズカンファレンス(ODC)2024 発表資料)
PDF
.NET Core 5 ~ Windows, Linux, OS X そして Docker まで ~
PDF
ADO.NET Entity Framework
PDF
[TL04] .NET 15 周年の今こそ考えるクラウドネイティブ アプリケーションと .NET の活用
PDF
PPTX
2015 0227 OSC-Spring Tokyo NETMF
PDF
どっちの VS ショー / 伝統の Visual Studio 2019、人気の Visual Studio Code
PDF
DEV-002_.NET Core/ASP.NET Core が実現するクロスプラットフォーム .NET の今と未来
PDF
Dotnetcore30forwindesktop
PDF
Linux & Mac OS でも動く! ~ オープンソース & クロスプラットフォーム .NET の歩き方 ~
PDF
Cloud から IoT まで、なんでもおまかせ ~ .NET 5 正式リリース!
PDF
18-D-1 .Net Framework 4 概要
Getting Started .NET Core
20201127 .NET 5
.NET Coreから概観する.NETのOSSへの取り組み
The Twelve-Factor (A|M)pp with C#
【BS4】時は来たれり。今こそ .NET 6 へ移行する時。
Ignite 2021秋 recap - 開発者向け新機能紹介
Hardware control by .NET Core 3.1
.NET Coreとツール類の今
PostgreSQL開発コミュニティに参加しよう! (オープンデベロッパーズカンファレンス(ODC)2024 発表資料)
.NET Core 5 ~ Windows, Linux, OS X そして Docker まで ~
ADO.NET Entity Framework
[TL04] .NET 15 周年の今こそ考えるクラウドネイティブ アプリケーションと .NET の活用
2015 0227 OSC-Spring Tokyo NETMF
どっちの VS ショー / 伝統の Visual Studio 2019、人気の Visual Studio Code
DEV-002_.NET Core/ASP.NET Core が実現するクロスプラットフォーム .NET の今と未来
Dotnetcore30forwindesktop
Linux & Mac OS でも動く! ~ オープンソース & クロスプラットフォーム .NET の歩き方 ~
Cloud から IoT まで、なんでもおまかせ ~ .NET 5 正式リリース!
18-D-1 .Net Framework 4 概要
Ad

More from Kazushi Kamegawa (11)

PDF
DevOps and compliance and security
PDF
はじめてのコンテナーDocker & Windows & Linux
PPTX
その後のBash on windows
PDF
Windows10時代のクロスプラットフォーム開発
PDF
Cross Platform CI for Visual Studio Online
PDF
はじめてのTeam Foundation ServerとVisual Studio Online
PDF
トラブル発生、その時あなたがすることは?
PDF
PowerShell and Release Management Server
PDF
Application insights で行ってみよう
PDF
TypeScript And ALM
PDF
Planning Effective Test Plan
DevOps and compliance and security
はじめてのコンテナーDocker & Windows & Linux
その後のBash on windows
Windows10時代のクロスプラットフォーム開発
Cross Platform CI for Visual Studio Online
はじめてのTeam Foundation ServerとVisual Studio Online
トラブル発生、その時あなたがすることは?
PowerShell and Release Management Server
Application insights で行ってみよう
TypeScript And ALM
Planning Effective Test Plan

NET5 and Diagnostics