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

Function NewServerMetricsForTesting

internal/channelz/server.go:53–60  ·  view source on GitHub ↗

NewServerMetricsForTesting returns an initialized ServerMetrics.

(started, succeeded, failed, timestamp int64)

Source from the content-addressed store, hash-verified

51
52// NewServerMetricsForTesting returns an initialized ServerMetrics.
53func NewServerMetricsForTesting(started, succeeded, failed, timestamp int64) *ServerMetrics {
54 sm := &ServerMetrics{}
55 sm.CallsStarted.Store(started)
56 sm.CallsSucceeded.Store(succeeded)
57 sm.CallsFailed.Store(failed)
58 sm.LastCallStartedTimestamp.Store(timestamp)
59 return sm
60}
61
62// CopyFrom copies the metrics data from the provided ServerMetrics
63// instance into the current instance.

Callers 1

TestGetServersMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestGetServersMethod · 0.74