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

Struct StubStatsHandler

internal/testutils/stubstatshandler.go:30–35  ·  view source on GitHub ↗

StubStatsHandler is a stats handler that is easy to customize within individual test cases. It is a stubbable implementation of google.golang.org/grpc/stats.Handler for testing purposes.

Source from the content-addressed store, hash-verified

28// individual test cases. It is a stubbable implementation of
29// google.golang.org/grpc/stats.Handler for testing purposes.
30type StubStatsHandler struct {
31 TagRPCF func(ctx context.Context, info *stats.RPCTagInfo) context.Context
32 HandleRPCF func(ctx context.Context, info stats.RPCStats)
33 TagConnF func(ctx context.Context, info *stats.ConnTagInfo) context.Context
34 HandleConnF func(ctx context.Context, info stats.ConnStats)
35}
36
37// TagRPC calls the StubStatsHandler's TagRPCF, if set.
38func (ssh *StubStatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected