]> git.sesse.net Git - cubemap/blobdiff - input_stats.h
Add preliminary support for input stream statistics.
[cubemap] / input_stats.h
diff --git a/input_stats.h b/input_stats.h
new file mode 100644 (file)
index 0000000..1149b7c
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef _INPUT_STATS_H
+#define _INPUT_STATS_H 1
+
+#include "thread.h"
+#include <string>
+#include <vector>
+
+// A thread that regularly writes out input statistics, ie. a list of all inputs
+// with some information about each. Very similar to StatsThread, but for inputs instead
+// of clients.
+
+class InputStatsThread : public Thread {
+public:
+       // Does not take ownership of the inputs.
+       InputStatsThread(const std::string &stats_file, int stats_interval, const std::vector<Input*> &inputs);
+
+private:
+       virtual void do_work();
+
+       std::string stats_file;
+       int stats_interval;
+       std::vector<Input*> inputs;
+};
+       
+#endif  // !defined(_INPUT_STATS_H)