@@ -12,13 +12,13 @@ internal sealed class MemoryPoolMetrics
1212{
1313 public const string MeterName = "Microsoft.AspNetCore.MemoryPool" ;
1414
15- public const string UsedMemoryName = "aspnetcore.memory_pool.used " ;
15+ public const string PooledMemoryName = "aspnetcore.memory_pool.pooled " ;
1616 public const string AllocatedMemoryName = "aspnetcore.memory_pool.allocated" ;
1717 public const string EvictedMemoryName = "aspnetcore.memory_pool.evicted" ;
1818 public const string RentedMemoryName = "aspnetcore.memory_pool.rented" ;
1919
2020 private readonly Meter _meter ;
21- private readonly UpDownCounter < long > _usedMemoryCounter ;
21+ private readonly UpDownCounter < long > _pooledMemoryCounter ;
2222 private readonly Counter < long > _allocatedMemoryCounter ;
2323 private readonly Counter < long > _evictedMemoryCounter ;
2424 private readonly Counter < long > _rentedMemoryCounter ;
@@ -27,41 +27,41 @@ public MemoryPoolMetrics(IMeterFactory meterFactory)
2727 {
2828 _meter = meterFactory . Create ( MeterName ) ;
2929
30- _usedMemoryCounter = _meter . CreateUpDownCounter < long > (
31- UsedMemoryName ,
30+ _pooledMemoryCounter = _meter . CreateUpDownCounter < long > (
31+ PooledMemoryName ,
3232 unit : "By" ,
33- description : "Number of bytes that are currently used by the pool." ) ;
33+ description : "Number of bytes currently held by the memory pool and available for reuse ." ) ;
3434
3535 _allocatedMemoryCounter = _meter . CreateCounter < long > (
36- AllocatedMemoryName ,
36+ AllocatedMemoryName ,
3737 unit : "By" ,
38- description : "Total number of allocations made by the pool." ) ;
38+ description : "Total number of allocations made by the memory pool." ) ;
3939
4040 _evictedMemoryCounter = _meter . CreateCounter < long > (
41- EvictedMemoryName ,
41+ EvictedMemoryName ,
4242 unit : "By" ,
43- description : "Total number of bytes that have been evicted from the pool." ) ;
43+ description : "Total number of bytes that have been evicted from the memory pool." ) ;
4444
4545 _rentedMemoryCounter = _meter . CreateCounter < long > (
4646 RentedMemoryName ,
4747 unit : "By" ,
48- description : "Total number of bytes rented from the pool." ) ;
48+ description : "Total number of bytes rented from the memory pool." ) ;
4949 }
5050
51- public void UpdateUsedMemory ( int bytes , string ? owner )
51+ public void UpdatePooledMemory ( int bytes , string ? owner )
5252 {
53- if ( _usedMemoryCounter . Enabled )
53+ if ( _pooledMemoryCounter . Enabled )
5454 {
55- UpdateUsedMemoryCore ( bytes , owner ) ;
55+ UpdatePooledMemoryCore ( bytes , owner ) ;
5656 }
5757 }
5858
59- private void UpdateUsedMemoryCore ( int bytes , string ? owner )
59+ private void UpdatePooledMemoryCore ( int bytes , string ? owner )
6060 {
6161 var tags = new TagList ( ) ;
6262 AddOwner ( ref tags , owner ) ;
6363
64- _usedMemoryCounter . Add ( bytes , tags ) ;
64+ _pooledMemoryCounter . Add ( bytes , tags ) ;
6565 }
6666
6767 public void AddAllocatedMemory ( int bytes , string ? owner )
0 commit comments