(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestPoolStats_RecordGet(t *testing.T) { |
| 52 | metrics.ResetPoolStats() |
| 53 | |
| 54 | _ = metrics.RecordNamedPoolGet("tokenizer") |
| 55 | _ = metrics.RecordNamedPoolPut("tokenizer") |
| 56 | |
| 57 | stats := metrics.GetPoolStats() |
| 58 | ts, ok := stats["tokenizer"] |
| 59 | if !ok { |
| 60 | t.Fatal("missing tokenizer key after reset+record") |
| 61 | } |
| 62 | if ts.Gets < 1 { |
| 63 | t.Errorf("expected Gets >= 1 after RecordNamedPoolGet, got %d", ts.Gets) |
| 64 | } |
| 65 | if ts.Puts < 1 { |
| 66 | t.Errorf("expected Puts >= 1 after RecordNamedPoolPut, got %d", ts.Puts) |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | func TestPoolStats_ActiveCalculation(t *testing.T) { |
| 71 | metrics.ResetPoolStats() |
nothing calls this directly
no test coverage detected