From 941bcce13fbef35d08fc44a84632625bd7087dc0 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Thu, 30 Sep 2021 21:26:21 +0200 Subject: structured cache: fixed how HEAD requests are handled the SetSuppressResponseBody() is currently sensitive to ordering and would end up getting called too late to apply fixes UE-129788, UE-129793 --- zenserver/testing/httptest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'zenserver/testing/httptest.cpp') diff --git a/zenserver/testing/httptest.cpp b/zenserver/testing/httptest.cpp index 18d63a6ef..01866a63b 100644 --- a/zenserver/testing/httptest.cpp +++ b/zenserver/testing/httptest.cpp @@ -14,6 +14,23 @@ HttpTestingService::HttpTestingService() [this](HttpRouterRequest& Req) { Req.ServerRequest().WriteResponse(HttpResponseCode::OK); }, HttpVerb::kGet); + m_Router.RegisterRoute( + "metrics", + [this](HttpRouterRequest& Req) { + metrics::OperationTiming::Scope _(m_TimingStats); + Req.ServerRequest().WriteResponse(HttpResponseCode::OK); + }, + HttpVerb::kGet); + + m_Router.RegisterRoute( + "get_metrics", + [this](HttpRouterRequest& Req) { + CbObjectWriter Cbo; + EmitSnapshot("requests", m_TimingStats, Cbo); + Req.ServerRequest().WriteResponse(HttpResponseCode::OK, Cbo.Save()); + }, + HttpVerb::kGet); + m_Router.RegisterRoute( "json", [this](HttpRouterRequest& Req) { -- cgit v1.2.3