WithStatsHandler returns a DialOption that specifies the stats handler for all the RPCs and underlying network connections in this ClientConn.
(h stats.Handler)
| 521 | // WithStatsHandler returns a DialOption that specifies the stats handler for |
| 522 | // all the RPCs and underlying network connections in this ClientConn. |
| 523 | func WithStatsHandler(h stats.Handler) DialOption { |
| 524 | return newFuncDialOption(func(o *dialOptions) { |
| 525 | if h == nil { |
| 526 | logger.Error("ignoring nil parameter in grpc.WithStatsHandler ClientOption") |
| 527 | // Do not allow a nil stats handler, which would otherwise cause |
| 528 | // panics. |
| 529 | return |
| 530 | } |
| 531 | o.copts.StatsHandlers = append(o.copts.StatsHandlers, h) |
| 532 | }) |
| 533 | } |
| 534 | |
| 535 | // withBinaryLogger returns a DialOption that specifies the binary logger for |
| 536 | // this ClientConn. |