(b *testing.B)
| 126 | } |
| 127 | |
| 128 | func BenchmarkServer_LogRequest_NopLogger(b *testing.B) { |
| 129 | s := &Server{} |
| 130 | |
| 131 | extra := new(ExtraLogFields) |
| 132 | ctx := context.WithValue(context.Background(), ExtraLogFieldsCtxKey, extra) |
| 133 | |
| 134 | req := httptest.NewRequest(http.MethodGet, "/", nil).WithContext(ctx) |
| 135 | rec := httptest.NewRecorder() |
| 136 | wrec := NewResponseRecorder(rec, nil, nil) |
| 137 | |
| 138 | duration := 50 * time.Millisecond |
| 139 | repl := NewTestReplacer(req) |
| 140 | bodyReader := &lengthReader{Source: req.Body} |
| 141 | |
| 142 | accLog := zap.NewNop() |
| 143 | |
| 144 | for b.Loop() { |
| 145 | s.logRequest(accLog, req, wrec, &duration, repl, bodyReader, false) |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | func BenchmarkServer_LogRequest_WithTrace(b *testing.B) { |
| 150 | s := &Server{} |
nothing calls this directly
no test coverage detected