Update intermittent_memory_spike.md
authorMario Hewardt <marioh@microsoft.com>
Thu, 9 May 2019 16:00:57 +0000 (09:00 -0700)
committerGitHub <noreply@github.com>
Thu, 9 May 2019 16:00:57 +0000 (09:00 -0700)
documentation/tutorial/intermittent_memory_spike.md

index bbb55a9423572f57c068a28a5b11dddd43a45c8c..cb507f90673313601a5d13eb2007373f39b02827 100644 (file)
@@ -57,10 +57,21 @@ We have two requirements in order to implemented a tool that will create a dump
 * Generate the actual core dump
 
 Let's start with the first requirement, reading dotnet counters. As explained earlier, we can use the EventPipe mechanism to read counters from the runtime. In this case, the provider that writes counter events is System.Runtime. Below is the code that 
-sets up the System.Runtime provider for use in our tool:
+sets up the System.Runtime provider for use in our tool (for brevity, error checking has been excluded):
 
+```csharp
+CounterProvider provider=null;
+KnownData.TryGetProvider("System.Runtime", out provider);
+string prov = provider.ToProviderString(1); 
+```
+The above code attempts to get the System.Runtime provider which we will need in the next section of code that actually configures and starts the counter collection:
+
+```csharp
+CounterProvider provider=null;
+KnownData.TryGetProvider("System.Runtime", out provider);
+string prov = provider.ToProviderString(1); 
+```
 
-  
 
 
 command to generate a core dump: