@@ -318,54 +318,54 @@ protected override void OnEventCommand(EventCommandEventArgs command)
318
318
// This is the convention for initializing counters in the RuntimeEventSource (lazily on the first enable command).
319
319
// They aren't disabled afterwards...
320
320
321
- _connectionsPerSecondCounter ??= new IncrementingPollingCounter ( "connections-per-second" , this , ( ) => _totalConnections )
321
+ _connectionsPerSecondCounter ??= new IncrementingPollingCounter ( "connections-per-second" , this , ( ) => Volatile . Read ( ref _totalConnections ) )
322
322
{
323
323
DisplayName = "Connection Rate" ,
324
324
DisplayRateTimeScale = TimeSpan . FromSeconds ( 1 )
325
325
} ;
326
326
327
- _totalConnectionsCounter ??= new PollingCounter ( "total-connections" , this , ( ) => _totalConnections )
327
+ _totalConnectionsCounter ??= new PollingCounter ( "total-connections" , this , ( ) => Volatile . Read ( ref _totalConnections ) )
328
328
{
329
329
DisplayName = "Total Connections" ,
330
330
} ;
331
331
332
- _tlsHandshakesPerSecondCounter ??= new IncrementingPollingCounter ( "tls-handshakes-per-second" , this , ( ) => _totalTlsHandshakes )
332
+ _tlsHandshakesPerSecondCounter ??= new IncrementingPollingCounter ( "tls-handshakes-per-second" , this , ( ) => Volatile . Read ( ref _totalTlsHandshakes ) )
333
333
{
334
334
DisplayName = "TLS Handshake Rate" ,
335
335
DisplayRateTimeScale = TimeSpan . FromSeconds ( 1 )
336
336
} ;
337
337
338
- _totalTlsHandshakesCounter ??= new PollingCounter ( "total-tls-handshakes" , this , ( ) => _totalTlsHandshakes )
338
+ _totalTlsHandshakesCounter ??= new PollingCounter ( "total-tls-handshakes" , this , ( ) => Volatile . Read ( ref _totalTlsHandshakes ) )
339
339
{
340
340
DisplayName = "Total TLS Handshakes" ,
341
341
} ;
342
342
343
- _currentTlsHandshakesCounter ??= new PollingCounter ( "current-tls-handshakes" , this , ( ) => _currentTlsHandshakes )
343
+ _currentTlsHandshakesCounter ??= new PollingCounter ( "current-tls-handshakes" , this , ( ) => Volatile . Read ( ref _currentTlsHandshakes ) )
344
344
{
345
345
DisplayName = "Current TLS Handshakes"
346
346
} ;
347
347
348
- _failedTlsHandshakesCounter ??= new PollingCounter ( "failed-tls-handshakes" , this , ( ) => _failedTlsHandshakes )
348
+ _failedTlsHandshakesCounter ??= new PollingCounter ( "failed-tls-handshakes" , this , ( ) => Volatile . Read ( ref _failedTlsHandshakes ) )
349
349
{
350
350
DisplayName = "Failed TLS Handshakes"
351
351
} ;
352
352
353
- _currentConnectionsCounter ??= new PollingCounter ( "current-connections" , this , ( ) => _currentConnections )
353
+ _currentConnectionsCounter ??= new PollingCounter ( "current-connections" , this , ( ) => Volatile . Read ( ref _currentConnections ) )
354
354
{
355
355
DisplayName = "Current Connections"
356
356
} ;
357
357
358
- _connectionQueueLengthCounter ??= new PollingCounter ( "connection-queue-length" , this , ( ) => _connectionQueueLength )
358
+ _connectionQueueLengthCounter ??= new PollingCounter ( "connection-queue-length" , this , ( ) => Volatile . Read ( ref _connectionQueueLength ) )
359
359
{
360
360
DisplayName = "Connection Queue Length"
361
361
} ;
362
362
363
- _httpRequestQueueLengthCounter ??= new PollingCounter ( "request-queue-length" , this , ( ) => _httpRequestQueueLength )
363
+ _httpRequestQueueLengthCounter ??= new PollingCounter ( "request-queue-length" , this , ( ) => Volatile . Read ( ref _httpRequestQueueLength ) )
364
364
{
365
365
DisplayName = "Request Queue Length"
366
366
} ;
367
367
368
- _currrentUpgradedHttpRequestsCounter ??= new PollingCounter ( "current-upgraded-requests" , this , ( ) => _currentUpgradedHttpRequests )
368
+ _currrentUpgradedHttpRequestsCounter ??= new PollingCounter ( "current-upgraded-requests" , this , ( ) => Volatile . Read ( ref _currentUpgradedHttpRequests ) )
369
369
{
370
370
DisplayName = "Current Upgraded Requests (WebSockets)"
371
371
} ;
0 commit comments