File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -462,13 +462,14 @@ func (s *Server) Drain() error { return s.pool.Drain() }
462
462
// String implements the Stringer interface.
463
463
func (s * Server ) String () string {
464
464
desc := s .Description ()
465
+ connState := atomic .LoadInt32 (& s .connectionstate )
465
466
str := fmt .Sprintf ("Addr: %s, Type: %s, State: %s" ,
466
- s .address , desc .Kind , connectionStateString (s . connectionstate ))
467
+ s .address , desc .Kind , connectionStateString (connState ))
467
468
if len (desc .Tags ) != 0 {
468
469
str += fmt .Sprintf (", Tag sets: %s" , desc .Tags )
469
470
}
470
- if s . connectionstate == connected {
471
- str += fmt .Sprintf (", Avergage RTT: %d" , s . averageRTT )
471
+ if connState == connected {
472
+ str += fmt .Sprintf (", Avergage RTT: %d" , desc . AverageRTT )
472
473
}
473
474
if desc .LastError != nil {
474
475
str += fmt .Sprintf (", Last error: %s" , desc .LastError )
You can’t perform that action at this time.
0 commit comments