MCPcopy
hub / github.com/grpc/grpc-go / WithStatsHandler

Function WithStatsHandler

dialoptions.go:523–533  ·  view source on GitHub ↗

WithStatsHandler returns a DialOption that specifies the stats handler for all the RPCs and underlying network connections in this ClientConn.

(h stats.Handler)

Source from the content-addressed store, hash-verified

521// WithStatsHandler returns a DialOption that specifies the stats handler for
522// all the RPCs and underlying network connections in this ClientConn.
523func 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.

Calls 2

newFuncDialOptionFunction · 0.85
ErrorMethod · 0.65