aboutsummaryrefslogtreecommitdiff
path: root/src/zennet/include
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-10-25 12:21:51 +0200
committerGitHub <[email protected]>2023-10-25 12:21:51 +0200
commit0b220255724020daea18ddb559f5edf3fdb1621b (patch)
tree7809227752c15d90111c4e600d80b59d90ad25d2 /src/zennet/include
parentNew rotating file logger that keeps on running regardless of errors (#495) (diff)
downloadzen-0b220255724020daea18ddb559f5edf3fdb1621b.tar.xz
zen-0b220255724020daea18ddb559f5edf3fdb1621b.zip
statsd metrics reporting (#496)
added support for reporting metrics via statsd style UDP messaging, which is supported by many monitoring solution providers this change adds reporting only of three cache related metrics (hit/miss/put) but this should be extended to include more metrics after additional evaluation
Diffstat (limited to 'src/zennet/include')
-rw-r--r--src/zennet/include/zennet/statsdclient.h40
-rw-r--r--src/zennet/include/zennet/zennet.h9
2 files changed, 49 insertions, 0 deletions
diff --git a/src/zennet/include/zennet/statsdclient.h b/src/zennet/include/zennet/statsdclient.h
new file mode 100644
index 000000000..a429286ae
--- /dev/null
+++ b/src/zennet/include/zennet/statsdclient.h
@@ -0,0 +1,40 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#pragma once
+
+#include <zencore/zencore.h>
+
+#include <memory>
+#include <string_view>
+
+namespace zen {
+
+class StatsTransportBase
+{
+public:
+ virtual ~StatsTransportBase() = 0;
+ virtual void SendMessage(const void* Data, size_t Size) = 0;
+};
+
+class StatsDaemonClient
+{
+public:
+ virtual ~StatsDaemonClient() = 0;
+
+ virtual void SetMessageSize(size_t MessageSize, bool UseThreads) = 0;
+ virtual void Flush() = 0;
+
+ virtual void Increment(std::string_view Metric) = 0;
+ virtual void Decrement(std::string_view Metric) = 0;
+ virtual void Count(std::string_view Metric, int64_t CountDelta) = 0;
+ virtual void Gauge(std::string_view Metric, uint64_t CurrentValue) = 0;
+ virtual void Meter(std::string_view Metric, uint64_t IncrementValue) = 0;
+
+ // Not (yet) implemented: Set,Timing
+};
+
+std::unique_ptr<StatsDaemonClient> CreateStatsDaemonClient(std::string_view TargetHost = "localhost", uint16_t TargetPort = 8125);
+
+void statsd_forcelink();
+
+} // namespace zen
diff --git a/src/zennet/include/zennet/zennet.h b/src/zennet/include/zennet/zennet.h
new file mode 100644
index 000000000..11b368cd1
--- /dev/null
+++ b/src/zennet/include/zennet/zennet.h
@@ -0,0 +1,9 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#pragma once
+
+namespace zen {
+
+void zennet_forcelinktests();
+
+}