X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=main.cpp;h=c40b78f5ef3ba20bea62cc86589903cd69aa9c0e;hb=bd694fdd3dd1417399aecead2c8b91fc4fe95ce8;hp=8d60826fb3d7a8436607446f27b572ba294bc237;hpb=4a33511c426ae90abb261f09fda1e31e0c30ca16;p=cubemap
diff --git a/main.cpp b/main.cpp
index 8d60826..c40b78f 100644
--- a/main.cpp
+++ b/main.cpp
@@ -20,6 +20,7 @@
#include "accesslog.h"
#include "config.h"
#include "input.h"
+#include "input_stats.h"
#include "log.h"
#include "markpool.h"
#include "serverpool.h"
@@ -448,6 +449,18 @@ start:
stats_thread->run();
}
+ InputStatsThread *input_stats_thread = NULL;
+ if (!config.input_stats_file.empty()) {
+ vector inputs_no_refcount;
+ for (multimap::iterator input_it = inputs.begin();
+ input_it != inputs.end(); ++input_it) {
+ inputs_no_refcount.push_back(input_it->second.input);
+ }
+
+ input_stats_thread = new InputStatsThread(config.input_stats_file, config.input_stats_interval, inputs_no_refcount);
+ input_stats_thread->run();
+ }
+
struct timeval server_start;
gettimeofday(&server_start, NULL);
if (state_fd != -1) {
@@ -466,6 +479,10 @@ start:
// OK, we've been HUPed. Time to shut down everything, serialize, and re-exec.
gettimeofday(&serialize_start, NULL);
+ if (input_stats_thread != NULL) {
+ input_stats_thread->stop();
+ delete input_stats_thread;
+ }
if (stats_thread != NULL) {
stats_thread->stop();
delete stats_thread;