Support collecting GC collect only trace using a simplified profile (#4568)
authorAndrew Au <andrewau@microsoft.com>
Fri, 29 Mar 2024 19:31:09 +0000 (12:31 -0700)
committerGitHub <noreply@github.com>
Fri, 29 Mar 2024 19:31:09 +0000 (19:31 +0000)
src/Microsoft.Diagnostics.Monitoring.EventPipe/Configuration/GcCollectConfiguration.cs [new file with mode: 0644]

diff --git a/src/Microsoft.Diagnostics.Monitoring.EventPipe/Configuration/GcCollectConfiguration.cs b/src/Microsoft.Diagnostics.Monitoring.EventPipe/Configuration/GcCollectConfiguration.cs
new file mode 100644 (file)
index 0000000..6cd5a56
--- /dev/null
@@ -0,0 +1,23 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Collections.Generic;
+using Microsoft.Diagnostics.NETCore.Client;
+
+namespace Microsoft.Diagnostics.Monitoring.EventPipe
+{
+    public sealed class GcCollectConfiguration : MonitoringSourceConfiguration
+    {
+        public GcCollectConfiguration()
+        {
+            RequestRundown = false;
+        }
+
+        public override IList<EventPipeProvider> GetProviders() =>
+            new EventPipeProvider[]
+            {
+                new EventPipeProvider("Microsoft-Windows-DotNETRuntime", System.Diagnostics.Tracing.EventLevel.Informational, (long) Tracing.Parsers.ClrTraceEventParser.Keywords.GC),
+                new EventPipeProvider("Microsoft-Windows-DotNETRuntimePrivate", System.Diagnostics.Tracing.EventLevel.Informational, (long) Tracing.Parsers.ClrTraceEventParser.Keywords.GC),
+            };
+    }
+}