aboutsummaryrefslogtreecommitdiff
path: root/zenserver/monitoring/httpstats.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-05-02 10:01:47 +0200
committerGitHub <[email protected]>2023-05-02 10:01:47 +0200
commit075d17f8ada47e990fe94606c3d21df409223465 (patch)
treee50549b766a2f3c354798a54ff73404217b4c9af /zenserver/monitoring/httpstats.cpp
parentfix: bundle shouldn't append content zip to zen (diff)
downloadzen-075d17f8ada47e990fe94606c3d21df409223465.tar.xz
zen-075d17f8ada47e990fe94606c3d21df409223465.zip
moved source directories into `/src` (#264)
* moved source directories into `/src` * updated bundle.lua for new `src` path * moved some docs, icon * removed old test trees
Diffstat (limited to 'zenserver/monitoring/httpstats.cpp')
-rw-r--r--zenserver/monitoring/httpstats.cpp62
1 files changed, 0 insertions, 62 deletions
diff --git a/zenserver/monitoring/httpstats.cpp b/zenserver/monitoring/httpstats.cpp
deleted file mode 100644
index 4d985f8c2..000000000
--- a/zenserver/monitoring/httpstats.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright Epic Games, Inc. All Rights Reserved.
-
-#include "httpstats.h"
-
-namespace zen {
-
-HttpStatsService::HttpStatsService() : m_Log(logging::Get("stats"))
-{
-}
-
-HttpStatsService::~HttpStatsService()
-{
-}
-
-const char*
-HttpStatsService::BaseUri() const
-{
- return "/stats/";
-}
-
-void
-HttpStatsService::RegisterHandler(std::string_view Id, IHttpStatsProvider& Provider)
-{
- RwLock::ExclusiveLockScope _(m_Lock);
- m_Providers.insert_or_assign(std::string(Id), &Provider);
-}
-
-void
-HttpStatsService::UnregisterHandler(std::string_view Id, IHttpStatsProvider& Provider)
-{
- ZEN_UNUSED(Provider);
-
- RwLock::ExclusiveLockScope _(m_Lock);
- m_Providers.erase(std::string(Id));
-}
-
-void
-HttpStatsService::HandleRequest(HttpServerRequest& Request)
-{
- using namespace std::literals;
-
- std::string_view Key = Request.RelativeUri();
-
- switch (Request.RequestVerb())
- {
- case HttpVerb::kHead:
- case HttpVerb::kGet:
- {
- RwLock::SharedLockScope _(m_Lock);
- if (auto It = m_Providers.find(std::string{Key}); It != end(m_Providers))
- {
- return It->second->HandleStatsRequest(Request);
- }
- }
-
- [[fallthrough]];
- default:
- return;
- }
-}
-
-} // namespace zen