aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/projectstore
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-09-28 23:57:31 +0200
committerGitHub <[email protected]>2023-09-28 23:57:31 +0200
commitbf20e4c8e63638792e69098d4d9810c1136ff627 (patch)
treefee82fc0d15910902a4a3c24a5564867748b6419 /src/zenserver/projectstore
parentadded more context to http response error message (#430) (diff)
downloadzen-bf20e4c8e63638792e69098d4d9810c1136ff627.tar.xz
zen-bf20e4c8e63638792e69098d4d9810c1136ff627.zip
adding more stats (#429)
- Feature: Add detailed stats on requests and data sizes on a per-bucket level, use parameter `cachestorestats=true` on the `/stats/z$` endpoint to enable - Feature: Add detailed stats on requests and data sizes on cidstore, use parameter `cidstorestats=true` on the `/stats/z$` endpoint to enable - Feature: Dashboard now accepts parameters in the URL which is passed on to the `/stats/z$` endpoint
Diffstat (limited to 'src/zenserver/projectstore')
-rw-r--r--src/zenserver/projectstore/httpprojectstore.cpp6
-rw-r--r--src/zenserver/projectstore/httpprojectstore.h16
2 files changed, 15 insertions, 7 deletions
diff --git a/src/zenserver/projectstore/httpprojectstore.cpp b/src/zenserver/projectstore/httpprojectstore.cpp
index 7ab847c73..3edcf5903 100644
--- a/src/zenserver/projectstore/httpprojectstore.cpp
+++ b/src/zenserver/projectstore/httpprojectstore.cpp
@@ -376,6 +376,9 @@ void
HttpProjectService::HandleRequest(HttpServerRequest& Request)
{
m_ProjectStats.RequestCount++;
+
+ metrics::OperationTiming::Scope $(m_HttpRequests);
+
if (m_Router.HandleRequest(Request) == false)
{
m_ProjectStats.BadRequestCount++;
@@ -392,6 +395,9 @@ HttpProjectService::HandleStatsRequest(HttpServerRequest& HttpReq)
const CidStoreSize CidSize = m_CidStore.TotalSize();
CbObjectWriter Cbo;
+
+ EmitSnapshot("requests", m_HttpRequests, Cbo);
+
Cbo.BeginObject("store");
{
Cbo.BeginObject("size");
diff --git a/src/zenserver/projectstore/httpprojectstore.h b/src/zenserver/projectstore/httpprojectstore.h
index 739dabe23..ac12d4d7c 100644
--- a/src/zenserver/projectstore/httpprojectstore.h
+++ b/src/zenserver/projectstore/httpprojectstore.h
@@ -2,6 +2,7 @@
#pragma once
+#include <zencore/stats.h>
#include <zenhttp/auth/authmgr.h>
#include <zenhttp/httpserver.h>
#include <zenhttp/httpstats.h>
@@ -82,13 +83,14 @@ private:
inline spdlog::logger& Log() { return m_Log; }
- spdlog::logger& m_Log;
- CidStore& m_CidStore;
- HttpRequestRouter m_Router;
- Ref<ProjectStore> m_ProjectStore;
- HttpStatsService& m_StatsService;
- AuthMgr& m_AuthMgr;
- ProjectStats m_ProjectStats;
+ spdlog::logger& m_Log;
+ CidStore& m_CidStore;
+ HttpRequestRouter m_Router;
+ Ref<ProjectStore> m_ProjectStore;
+ HttpStatsService& m_StatsService;
+ AuthMgr& m_AuthMgr;
+ ProjectStats m_ProjectStats;
+ metrics::OperationTiming m_HttpRequests;
};
} // namespace zen