diff options
| author | Martin Ridgers <[email protected]> | 2021-10-01 11:50:43 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-10-01 11:50:43 +0200 |
| commit | a2dc648979bad70037e19ce75ae506f9455e8fd3 (patch) | |
| tree | 4d902270db982a24df05eecdf53d0535b601d582 /zenserver/testing/httptest.cpp | |
| parent | Removed `-fshort-wchar` compiler flag on Linux (diff) | |
| parent | Added upstream cache perf metrics. (diff) | |
| download | zen-a2dc648979bad70037e19ce75ae506f9455e8fd3.tar.xz zen-a2dc648979bad70037e19ce75ae506f9455e8fd3.zip | |
Merged main
Diffstat (limited to 'zenserver/testing/httptest.cpp')
| -rw-r--r-- | zenserver/testing/httptest.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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 @@ -15,6 +15,23 @@ HttpTestingService::HttpTestingService() 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) { CbObjectWriter Obj; |