@@ -136,31 +136,31 @@ protected override void OnEventCommand(EventCommandEventArgs command)
136136 // This is the convention for initializing counters in the RuntimeEventSource (lazily on the first enable command).
137137 // They aren't disabled afterwards...
138138
139- _totalCallsCounter ??= new PollingCounter ( "total-calls" , this , ( ) => _totalCalls )
139+ _totalCallsCounter ??= new PollingCounter ( "total-calls" , this , ( ) => Volatile . Read ( ref _totalCalls ) )
140140 {
141141 DisplayName = "Total Calls" ,
142142 } ;
143- _currentCallsCounter ??= new PollingCounter ( "current-calls" , this , ( ) => _currentCalls )
143+ _currentCallsCounter ??= new PollingCounter ( "current-calls" , this , ( ) => Volatile . Read ( ref _currentCalls ) )
144144 {
145145 DisplayName = "Current Calls"
146146 } ;
147- _callsFailedCounter ??= new PollingCounter ( "calls-failed" , this , ( ) => _callsFailed )
147+ _callsFailedCounter ??= new PollingCounter ( "calls-failed" , this , ( ) => Volatile . Read ( ref _callsFailed ) )
148148 {
149149 DisplayName = "Total Calls Failed" ,
150150 } ;
151- _callsDeadlineExceededCounter ??= new PollingCounter ( "calls-deadline-exceeded" , this , ( ) => _callsDeadlineExceeded )
151+ _callsDeadlineExceededCounter ??= new PollingCounter ( "calls-deadline-exceeded" , this , ( ) => Volatile . Read ( ref _callsDeadlineExceeded ) )
152152 {
153153 DisplayName = "Total Calls Deadline Exceeded" ,
154154 } ;
155- _messagesSentCounter ??= new PollingCounter ( "messages-sent" , this , ( ) => _messageSent )
155+ _messagesSentCounter ??= new PollingCounter ( "messages-sent" , this , ( ) => Volatile . Read ( ref _messageSent ) )
156156 {
157157 DisplayName = "Total Messages Sent" ,
158158 } ;
159- _messagesReceivedCounter ??= new PollingCounter ( "messages-received" , this , ( ) => _messageReceived )
159+ _messagesReceivedCounter ??= new PollingCounter ( "messages-received" , this , ( ) => Volatile . Read ( ref _messageReceived ) )
160160 {
161161 DisplayName = "Total Messages Received" ,
162162 } ;
163- _callsUnimplementedCounter ??= new PollingCounter ( "calls-unimplemented" , this , ( ) => _callsUnimplemented )
163+ _callsUnimplementedCounter ??= new PollingCounter ( "calls-unimplemented" , this , ( ) => Volatile . Read ( ref _callsUnimplemented ) )
164164 {
165165 DisplayName = "Total Calls Unimplemented" ,
166166 } ;
0 commit comments