NewServerMetricsForTesting returns an initialized ServerMetrics.
(started, succeeded, failed, timestamp int64)
| 51 | |
| 52 | // NewServerMetricsForTesting returns an initialized ServerMetrics. |
| 53 | func 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. |