(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func (s) TestServerMetrics_Setters(t *testing.T) { |
| 37 | smr := NewServerMetricsRecorder() |
| 38 | |
| 39 | smr.SetCPUUtilization(0.1) |
| 40 | smr.SetMemoryUtilization(0.2) |
| 41 | smr.SetApplicationUtilization(0.3) |
| 42 | smr.SetQPS(0.4) |
| 43 | smr.SetEPS(0.5) |
| 44 | smr.SetNamedUtilization("x", 0.6) |
| 45 | |
| 46 | want := &ServerMetrics{ |
| 47 | CPUUtilization: 0.1, |
| 48 | MemUtilization: 0.2, |
| 49 | AppUtilization: 0.3, |
| 50 | QPS: 0.4, |
| 51 | EPS: 0.5, |
| 52 | Utilization: map[string]float64{"x": 0.6}, |
| 53 | NamedMetrics: map[string]float64{}, |
| 54 | RequestCost: map[string]float64{}, |
| 55 | } |
| 56 | |
| 57 | got := smr.ServerMetrics() |
| 58 | if d := cmp.Diff(got, want); d != "" { |
| 59 | t.Fatalf("unexpected server metrics: -got +want: %v", d) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | func (s) TestServerMetrics_Deleters(t *testing.T) { |
| 64 | smr := NewServerMetricsRecorder() |
nothing calls this directly
no test coverage detected