From f0c75349145577d9f47ac23f6230926e8618d022 Mon Sep 17 00:00:00 2001 From: Badre BSAILA <54767641+pedrobsaila@users.noreply.github.com> Date: Tue, 26 Sep 2023 23:24:22 +0200 Subject: [PATCH] Add DebuggerDisplay to Meter and Instruments (#91496) --- .../src/System/Diagnostics/Metrics/Instrument.common.cs | 1 + .../src/System/Diagnostics/Metrics/Meter.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Instrument.common.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Instrument.common.cs index 6129c0686b250..bc813c0d4cfe4 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Instrument.common.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Instrument.common.cs @@ -11,6 +11,7 @@ namespace System.Diagnostics.Metrics /// /// This class supports only the following generic parameter types: , , , , , , and /// + [DebuggerDisplay("Name = {Name}, Meter = {Meter.Name}")] public abstract partial class Instrument : Instrument where T : struct { /// diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Meter.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Meter.cs index 60314b1d5b4c0..a6ce8e93f4816 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Meter.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Meter.cs @@ -10,6 +10,7 @@ namespace System.Diagnostics.Metrics /// /// Meter is the class responsible for creating and tracking the Instruments. /// + [DebuggerDisplay("Name = {Name}, Instruments = {_instruments.Count}")] public class Meter : IDisposable { private static readonly List s_allMeters = new List();