diff --git a/src/Servers/Kestrel/Core/test/PinnedBlockMemoryPoolTests.cs b/src/Servers/Kestrel/Core/test/PinnedBlockMemoryPoolTests.cs index f35fd05c36ef..1f8d0edebe39 100644 --- a/src/Servers/Kestrel/Core/test/PinnedBlockMemoryPoolTests.cs +++ b/src/Servers/Kestrel/Core/test/PinnedBlockMemoryPoolTests.cs @@ -231,7 +231,7 @@ public async Task EvictionsAreScheduled() public void CurrentMemoryMetricTracksPooledMemory() { var testMeterFactory = new TestMeterFactory(); - using var currentMemoryMetric = new MetricCollector(testMeterFactory, "Microsoft.AspNetCore.MemoryPool", "aspnetcore.memorypool.current_memory"); + using var currentMemoryMetric = new MetricCollector(testMeterFactory, "Microsoft.AspNetCore.MemoryPool", "aspnetcore.memory_pool.current_memory"); var pool = new PinnedBlockMemoryPool(testMeterFactory); @@ -267,7 +267,7 @@ public void CurrentMemoryMetricTracksPooledMemory() public void TotalAllocatedMetricTracksAllocatedMemory() { var testMeterFactory = new TestMeterFactory(); - using var totalMemoryMetric = new MetricCollector(testMeterFactory, "Microsoft.AspNetCore.MemoryPool", "aspnetcore.memorypool.total_allocated"); + using var totalMemoryMetric = new MetricCollector(testMeterFactory, "Microsoft.AspNetCore.MemoryPool", "aspnetcore.memory_pool.total_allocated"); var pool = new PinnedBlockMemoryPool(testMeterFactory); @@ -290,7 +290,7 @@ public void TotalAllocatedMetricTracksAllocatedMemory() public void TotalRentedMetricTracksRentOperations() { var testMeterFactory = new TestMeterFactory(); - using var rentMetric = new MetricCollector(testMeterFactory, "Microsoft.AspNetCore.MemoryPool", "aspnetcore.memorypool.total_rented"); + using var rentMetric = new MetricCollector(testMeterFactory, "Microsoft.AspNetCore.MemoryPool", "aspnetcore.memory_pool.total_rented"); var pool = new PinnedBlockMemoryPool(testMeterFactory); @@ -315,7 +315,7 @@ public void TotalRentedMetricTracksRentOperations() public void EvictedMemoryMetricTracksEvictedMemory() { var testMeterFactory = new TestMeterFactory(); - using var evictMetric = new MetricCollector(testMeterFactory, "Microsoft.AspNetCore.MemoryPool", "aspnetcore.memorypool.evicted_memory"); + using var evictMetric = new MetricCollector(testMeterFactory, "Microsoft.AspNetCore.MemoryPool", "aspnetcore.memory_pool.evicted_memory"); var pool = new PinnedBlockMemoryPool(testMeterFactory); @@ -352,7 +352,7 @@ public void EvictedMemoryMetricTracksEvictedMemory() public void MetricsAreAggregatedAcrossPoolsWithSameMeterFactory() { var testMeterFactory = new TestMeterFactory(); - using var rentMetric = new MetricCollector(testMeterFactory, "Microsoft.AspNetCore.MemoryPool", "aspnetcore.memorypool.total_rented"); + using var rentMetric = new MetricCollector(testMeterFactory, "Microsoft.AspNetCore.MemoryPool", "aspnetcore.memory_pool.total_rented"); var pool1 = new PinnedBlockMemoryPool(testMeterFactory); var pool2 = new PinnedBlockMemoryPool(testMeterFactory); diff --git a/src/Shared/Buffers.MemoryPool/PinnedBlockMemoryPoolMetrics.cs b/src/Shared/Buffers.MemoryPool/PinnedBlockMemoryPoolMetrics.cs index 213fe3e84218..0211f2bc610c 100644 --- a/src/Shared/Buffers.MemoryPool/PinnedBlockMemoryPoolMetrics.cs +++ b/src/Shared/Buffers.MemoryPool/PinnedBlockMemoryPoolMetrics.cs @@ -22,23 +22,23 @@ public PinnedBlockMemoryPoolMetrics(IMeterFactory meterFactory) _meter = meterFactory.Create(MeterName); _currentMemory = _meter.CreateUpDownCounter( - "aspnetcore.memorypool.current_memory", - unit: "{bytes}", + "aspnetcore.memory_pool.current_memory", + unit: "By", description: "Number of bytes that are currently pooled by the pool."); _totalAllocatedMemory = _meter.CreateCounter( - "aspnetcore.memorypool.total_allocated", - unit: "{bytes}", + "aspnetcore.memory_pool.total_allocated", + unit: "By", description: "Total number of allocations made by the pool."); _evictedMemory = _meter.CreateCounter( - "aspnetcore.memorypool.evicted_memory", - unit: "{bytes}", + "aspnetcore.memory_pool.evicted_memory", + unit: "By", description: "Total number of bytes that have been evicted."); _totalRented = _meter.CreateCounter( - "aspnetcore.memorypool.total_rented", - unit: "{bytes}", + "aspnetcore.memory_pool.total_rented", + unit: "By", description: "Total number of rented bytes from the pool."); }