extractServerInfo extracts server address and port from connection info For client connections, this is the remote endpoint (server address)
(cn redis.ConnInfo)
| 474 | // extractServerInfo extracts server address and port from connection info |
| 475 | // For client connections, this is the remote endpoint (server address) |
| 476 | func extractServerInfo(cn redis.ConnInfo) (addr, port string) { |
| 477 | if cn == nil { |
| 478 | return "", "" |
| 479 | } |
| 480 | |
| 481 | remoteAddr := cn.RemoteAddr() |
| 482 | if remoteAddr == nil { |
| 483 | return "", "" |
| 484 | } |
| 485 | |
| 486 | addrStr := remoteAddr.String() |
| 487 | host, portStr := parseAddr(addrStr) |
| 488 | return host, portStr |
| 489 | } |
| 490 | |
| 491 | // RecordConnectionCreateTime records the time it took to create a new connection |
| 492 | func (r *metricsRecorder) RecordConnectionCreateTime( |
no test coverage detected