@@ -60,62 +60,6 @@ public void Dispose() {}
6060 internal sealed partial class RecyclableMemoryStreamManager
6161 {
6262 public static readonly Events EventsWriter = new Events ( ) ;
63- private Counters Counter { get ; }
64-
65- public sealed class Counters : IDisposable
66- {
67- private ReadOnlyCollection < PollingCounter > Polls { get ; }
68-
69- public Counters ( RecyclableMemoryStreamManager instance )
70- {
71- // ReSharper disable once UnusedParameter.Local
72- PollingCounter Create ( string name , Func < double > poll , string description ) =>
73- new PollingCounter ( name , EventsWriter , poll )
74- // ReSharper disable once RedundantEmptyObjectOrCollectionInitializer
75- {
76- #if NETSTANDARD2_1
77- DisplayName = description
78- #endif
79- } ;
80-
81-
82- var polls = new List < PollingCounter > ( )
83- {
84- { Create ( "blocks" , ( ) => _blocks , "Pooled blocks active" ) } ,
85- { Create ( "large-buffers" , ( ) => _largeBuffers , "Large buffers active" ) } ,
86- { Create ( "large-buffers-free" , ( ) => instance . LargeBuffersFree , "Large buffers free" ) } ,
87- { Create ( "large-pool-inuse" , ( ) => instance . LargePoolInUseSize , "Large pool in use size" ) } ,
88- { Create ( "small-pool-free" , ( ) => instance . SmallBlocksFree , "Small pool free blocks" ) } ,
89- { Create ( "small-pool-inuse" , ( ) => instance . SmallPoolInUseSize , "Small pool in use size" ) } ,
90- { Create ( "small-pool-free" , ( ) => instance . SmallPoolFreeSize , "Small pool free size" ) } ,
91- { Create ( "small-pool-max" , ( ) => instance . MaximumFreeSmallPoolBytes , "Small pool max size" ) } ,
92- { Create ( "memory-streams" , ( ) => _memoryStreams , "Active memory streams" ) } ,
93- } ;
94- Polls = new ReadOnlyCollection < PollingCounter > ( polls ) ;
95-
96-
97- }
98-
99- private long _blocks ;
100- internal void ReportBlockCreated ( ) => Interlocked . Increment ( ref _blocks ) ;
101-
102- internal void ReportBlockDiscarded ( ) => Interlocked . Decrement ( ref _blocks ) ;
103-
104- private long _largeBuffers ;
105- internal void ReportLargeBufferCreated ( ) => Interlocked . Increment ( ref _largeBuffers ) ;
106-
107- internal void ReportLargeBufferDiscarded ( ) => Interlocked . Decrement ( ref _largeBuffers ) ;
108-
109- private long _memoryStreams ;
110- internal void ReportStreamCreated ( ) => Interlocked . Increment ( ref _memoryStreams ) ;
111-
112- internal void ReportStreamDisposed ( ) => Interlocked . Decrement ( ref _memoryStreams ) ;
113-
114- public void Dispose ( )
115- {
116- foreach ( var p in Polls ) p . Dispose ( ) ;
117- }
118- }
11963
12064 [ EventSource ( Name = "Elasticsearch-Net-RecyclableMemoryStream" , Guid = "{AD44FDAC-D3FC-460A-9EBE-E55A3569A8F6}" ) ]
12165 public sealed class Events : EventSource
0 commit comments