Skip to content

Commit 7faef8c

Browse files
committed
Fix/update field names
1 parent b8a218c commit 7faef8c

File tree

1 file changed

+21
-21
lines changed
  • src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics

1 file changed

+21
-21
lines changed

src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,31 @@ static RuntimeMetrics()
3030
// in its `OnMeasurementRecorded` callback.
3131
if (t_handlingFirstChanceException) return;
3232
t_handlingFirstChanceException = true;
33-
s_exceptionCount.Add(1, new KeyValuePair<string, object?>("error.type", e.Exception.GetType().Name));
33+
s_exceptions.Add(1, new KeyValuePair<string, object?>("error.type", e.Exception.GetType().Name));
3434
t_handlingFirstChanceException = false;
3535
};
3636
}
3737

38-
private static readonly ObservableCounter<long> s_gcCollectionsCounter = s_meter.CreateObservableCounter(
38+
private static readonly ObservableCounter<long> s_gcCollections = s_meter.CreateObservableCounter(
3939
"dotnet.gc.collections.count",
4040
GetGarbageCollectionCounts,
4141
unit: "{collection}",
4242
description: "Number of garbage collections that have occurred since the process has started.");
4343

44-
private static readonly ObservableUpDownCounter<long> s_gcObjectsSize = s_meter.CreateObservableUpDownCounter(
44+
private static readonly ObservableUpDownCounter<long> s_processWorkingSet = s_meter.CreateObservableUpDownCounter(
4545
"dotnet.process.memory.working_set",
4646
() => Environment.WorkingSet,
4747
unit: "By",
4848
description: "The number of bytes of physical memory mapped to the process context.");
4949

5050
#if NET
51-
private static readonly ObservableCounter<long> s_gcMemoryTotalAllocated = s_meter.CreateObservableCounter(
51+
private static readonly ObservableCounter<long> s_gcHeapTotalAllocated = s_meter.CreateObservableCounter(
5252
"dotnet.gc.heap.total_allocated",
5353
() => GC.GetTotalAllocatedBytes(),
5454
unit: "By",
5555
description: "The approximate number of bytes allocated on the managed GC heap since the process has started. The returned value does not include any native allocations.");
5656

57-
private static readonly ObservableUpDownCounter<long> s_gcMemoryCommited = s_meter.CreateObservableUpDownCounter(
57+
private static readonly ObservableUpDownCounter<long> s_gcLastCollectionMemoryCommitted = s_meter.CreateObservableUpDownCounter(
5858
"dotnet.gc.last_collection.memory.committed_size",
5959
() =>
6060
{
@@ -67,13 +67,13 @@ static RuntimeMetrics()
6767
unit: "By",
6868
description: "The amount of committed virtual memory in use by the .NET GC, as observed during the latest garbage collection.");
6969

70-
private static readonly ObservableUpDownCounter<long> s_gcHeapSize = s_meter.CreateObservableUpDownCounter(
70+
private static readonly ObservableUpDownCounter<long> s_gcLastCollectionHeapSize = s_meter.CreateObservableUpDownCounter(
7171
"dotnet.gc.last_collection.heap.size",
7272
GetHeapSizes,
7373
unit: "By",
7474
description: "The managed GC heap size (including fragmentation), as observed during the latest garbage collection.");
7575

76-
private static readonly ObservableUpDownCounter<long> s_gcHeapFragmentation = s_meter.CreateObservableUpDownCounter(
76+
private static readonly ObservableUpDownCounter<long> s_gcLastCollectionFragmentationSize = s_meter.CreateObservableUpDownCounter(
7777
"dotnet.gc.last_collection.heap.fragmentation.size",
7878
GetHeapFragmentation,
7979
unit: "By",
@@ -134,38 +134,38 @@ static RuntimeMetrics()
134134
description: "The number of timer instances that are currently active. An active timer is registered to tick at some point in the future and has not yet been canceled.");
135135
#endif
136136

137-
private static readonly ObservableUpDownCounter<long> s_assemblyCount = s_meter.CreateObservableUpDownCounter(
137+
private static readonly ObservableUpDownCounter<long> s_assembliesCount = s_meter.CreateObservableUpDownCounter(
138138
"dotnet.assemblies.count",
139139
() => (long)AppDomain.CurrentDomain.GetAssemblies().Length,
140140
unit: "{assembly}",
141141
description: "The number of .NET assemblies that are currently loaded.");
142142

143-
private static readonly Counter<long> s_exceptionCount = s_meter.CreateCounter<long>(
143+
private static readonly Counter<long> s_exceptions = s_meter.CreateCounter<long>(
144144
"dotnet.exceptions",
145145
unit: "{exception}",
146146
description: "The number of exceptions that have been thrown in managed code.");
147147

148-
private static readonly ObservableUpDownCounter<long> s_cpuCount = s_meter.CreateObservableUpDownCounter(
148+
private static readonly ObservableUpDownCounter<long> s_processCpuCount = s_meter.CreateObservableUpDownCounter(
149149
"dotnet.process.cpu.count",
150150
() => (long)Environment.ProcessorCount,
151151
unit: "{cpu}",
152152
description: "The number of processors available to the process.");
153153

154-
private static readonly ObservableCounter<double> s_cpuTime = s_meter.CreateObservableCounter(
154+
private static readonly ObservableCounter<double> s_processCpuTime = s_meter.CreateObservableCounter(
155155
"dotnet.process.cpu.time",
156156
GetCpuTime,
157157
unit: "s",
158158
description: "CPU time used by the process as reported by the CLR.");
159159

160160
public static bool IsEnabled()
161161
{
162-
return s_gcCollectionsCounter.Enabled
163-
|| s_gcObjectsSize.Enabled
162+
return s_gcCollections.Enabled
163+
|| s_processWorkingSet.Enabled
164164
#if NET
165-
|| s_gcMemoryTotalAllocated.Enabled
166-
|| s_gcMemoryCommited.Enabled
167-
|| s_gcHeapSize.Enabled
168-
|| s_gcHeapFragmentation.Enabled
165+
|| s_gcHeapTotalAllocated.Enabled
166+
|| s_gcLastCollectionMemoryCommitted.Enabled
167+
|| s_gcLastCollectionHeapSize.Enabled
168+
|| s_gcLastCollectionFragmentationSize.Enabled
169169
|| s_gcPauseTime.Enabled
170170
|| s_jitCompiledSize.Enabled
171171
|| s_jitCompiledMethodCount.Enabled
@@ -176,10 +176,10 @@ public static bool IsEnabled()
176176
|| s_threadPoolCompletedWorkItems.Enabled
177177
|| s_threadPoolQueueLength.Enabled
178178
#endif
179-
|| s_assemblyCount.Enabled
180-
|| s_exceptionCount.Enabled
181-
|| s_cpuCount.Enabled
182-
|| s_cpuTime.Enabled;
179+
|| s_assembliesCount.Enabled
180+
|| s_exceptions.Enabled
181+
|| s_processCpuCount.Enabled
182+
|| s_processCpuTime.Enabled;
183183
}
184184

185185
private static IEnumerable<Measurement<long>> GetGarbageCollectionCounts()

0 commit comments

Comments
 (0)