diff --git a/internal/transport/http/reqid/reqid_test.go b/internal/transport/http/reqid/reqid_test.go index 0064b90..48ba99c 100644 --- a/internal/transport/http/reqid/reqid_test.go +++ b/internal/transport/http/reqid/reqid_test.go @@ -33,3 +33,17 @@ func TestMiddleware(t *testing.T) { assert.Equal(t, http.StatusOK, w.Code) assert.NotEmpty(t, w.Header().Get(headerRequestID)) } + +func BenchmarkMiddleware(b *testing.B) { + r := gin.New() + r.Use(Middleware()) + r.GET("/", testHandler) + + w := httptest.NewRecorder() + req, err := http.NewRequest(http.MethodGet, "/", nil) + require.NoError(b, err) + + for i := 0; i < b.N; i++ { + r.ServeHTTP(w, req) + } +}