aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-11-06 14:50:33 +0100
committerGitHub <[email protected]>2023-11-06 14:50:33 +0100
commit0b184fd2a65852028672a7a0013ec794c7e0b071 (patch)
tree8f2d6f8296016943c1544716a6110be58729b4c6 /src/zenserver
parentfixed issue where file log sink would get the wrong pattern assigned (#513) (diff)
downloadzen-0b184fd2a65852028672a7a0013ec794c7e0b071.tar.xz
zen-0b184fd2a65852028672a7a0013ec794c7e0b071.zip
statsd for cas (#511)
* separate statsd interfaces so they can be accessible to zenstore * statsd for cas
Diffstat (limited to 'src/zenserver')
-rw-r--r--src/zenserver/cache/structuredcachestore.cpp2
-rw-r--r--src/zenserver/cache/structuredcachestore.h2
-rw-r--r--src/zenserver/stats/statsreporter.h9
-rw-r--r--src/zenserver/zenserver.cpp1
4 files changed, 5 insertions, 9 deletions
diff --git a/src/zenserver/cache/structuredcachestore.cpp b/src/zenserver/cache/structuredcachestore.cpp
index 55ab6bf31..09c9f1468 100644
--- a/src/zenserver/cache/structuredcachestore.cpp
+++ b/src/zenserver/cache/structuredcachestore.cpp
@@ -693,7 +693,7 @@ ZenCacheStore::Stats(bool IncludeNamespaceStats)
}
void
-ZenCacheStore::ReportMetrics(StatsDaemonClient& Statsd)
+ZenCacheStore::ReportMetrics(StatsMetrics& Statsd)
{
const bool IncludeNamespaceStats = false;
const CacheStoreStats Now = Stats(IncludeNamespaceStats);
diff --git a/src/zenserver/cache/structuredcachestore.h b/src/zenserver/cache/structuredcachestore.h
index a3cac0d44..4ab8f90f0 100644
--- a/src/zenserver/cache/structuredcachestore.h
+++ b/src/zenserver/cache/structuredcachestore.h
@@ -220,7 +220,7 @@ public:
std::function<void(const IoHash& Key, const CacheValueDetails::ValueDetails& Details)>&& Fn);
// StatsProvider
- virtual void ReportMetrics(StatsDaemonClient& Statsd) override;
+ virtual void ReportMetrics(StatsMetrics& Statsd) override;
private:
const ZenCacheNamespace* FindNamespace(std::string_view Namespace) const;
diff --git a/src/zenserver/stats/statsreporter.h b/src/zenserver/stats/statsreporter.h
index ed6ec6c55..2f93aa8bb 100644
--- a/src/zenserver/stats/statsreporter.h
+++ b/src/zenserver/stats/statsreporter.h
@@ -5,17 +5,12 @@
#include "config.h"
#include <zencore/thread.h>
+#include <zenutil/statsreporter.h>
namespace zen {
class StatsDaemonClient;
-class StatsProvider
-{
-public:
- virtual void ReportMetrics(StatsDaemonClient& Statsd) = 0;
-};
-
class StatsReporter
{
public:
@@ -27,8 +22,8 @@ public:
void Initialize(const ZenStatsConfig& Config);
void Shutdown();
- void AddProvider(StatsProvider* Provider);
void ReportStats();
+ void AddProvider(StatsProvider* Provider);
private:
RwLock m_Lock;
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp
index f40602769..282dc73cf 100644
--- a/src/zenserver/zenserver.cpp
+++ b/src/zenserver/zenserver.cpp
@@ -525,6 +525,7 @@ ZenServer::InitializeStructuredCache(const ZenServerOptions& ServerOptions)
m_Http->RegisterService(*m_UpstreamService);
m_StatsReporter.AddProvider(m_CacheStore.Get());
+ m_StatsReporter.AddProvider(m_CidStore.get());
}
void