summaryrefslogtreecommitdiffstats
path: root/telemetry.h
diff options
context:
space:
mode:
Diffstat (limited to 'telemetry.h')
-rw-r--r--telemetry.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/telemetry.h b/telemetry.h
new file mode 100644
index 0000000..0538090
--- /dev/null
+++ b/telemetry.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <cstdint>
+
+namespace xmrstak
+{
+
+class telemetry
+{
+public:
+ telemetry(size_t iThd);
+ void push_perf_value(size_t iThd, uint64_t iHashCount, uint64_t iTimestamp);
+ double calc_telemetry_data(size_t iLastMilisec, size_t iThread);
+
+private:
+ constexpr static size_t iBucketSize = 2 << 11; //Power of 2 to simplify calculations
+ constexpr static size_t iBucketMask = iBucketSize - 1;
+ uint32_t* iBucketTop;
+ uint64_t** ppHashCounts;
+ uint64_t** ppTimestamps;
+};
+
+} // namepsace xmrstak
OpenPOWER on IntegriCloud