diff options
Diffstat (limited to 'src/zenserver/storage/objectstore/objectstore.cpp')
| -rw-r--r-- | src/zenserver/storage/objectstore/objectstore.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/zenserver/storage/objectstore/objectstore.cpp b/src/zenserver/storage/objectstore/objectstore.cpp index dec0c3cee..d6516fa1a 100644 --- a/src/zenserver/storage/objectstore/objectstore.cpp +++ b/src/zenserver/storage/objectstore/objectstore.cpp @@ -226,7 +226,7 @@ HttpObjectStoreService::HttpObjectStoreService(HttpStatsService& StatsService, H , m_StatusService(StatusService) , m_Cfg(std::move(Cfg)) { - Inititalize(); + Initialize(); m_StatsService.RegisterHandler("obj", *this); m_StatusService.RegisterHandler("obj", *this); } @@ -266,12 +266,19 @@ HttpObjectStoreService::HandleStatusRequest(HttpServerRequest& Request) void HttpObjectStoreService::HandleStatsRequest(HttpServerRequest& Request) { + Request.WriteResponse(HttpResponseCode::OK, CollectStats()); +} + +CbObject +HttpObjectStoreService::CollectStats() +{ + ZEN_TRACE_CPU("HttpObjectStoreService::Stats"); CbObjectWriter Cbo; EmitSnapshot("requests", m_HttpRequests, Cbo); Cbo << "total_bytes_served" << m_TotalBytesServed.load(); - Request.WriteResponse(HttpResponseCode::OK, Cbo.Save()); + return Cbo.Save(); } uint64_t @@ -281,12 +288,12 @@ HttpObjectStoreService::GetActivityCounter() } void -HttpObjectStoreService::Inititalize() +HttpObjectStoreService::Initialize() { - ZEN_TRACE_CPU("HttpObjectStoreService::Inititalize"); + ZEN_TRACE_CPU("HttpObjectStoreService::Initialize"); namespace fs = std::filesystem; - ZEN_LOG_INFO(LogObj, "Initialzing Object Store in '{}'", m_Cfg.RootDirectory); + ZEN_LOG_INFO(LogObj, "Initializing Object Store in '{}'", m_Cfg.RootDirectory); const fs::path BucketsPath = m_Cfg.RootDirectory / "buckets"; if (!IsDir(BucketsPath)) |