]> git.sesse.net Git - cubemap/blobdiff - udpinput.cpp
Add latency statistics to the Munin plugin.
[cubemap] / udpinput.cpp
index 559e9cd29c0c773c7519f814eea5cc3b265e96db..81aef7f9c9bbae265b832f9fd8f1ba353c311c8a 100644 (file)
@@ -6,6 +6,7 @@
 #include <sys/socket.h>
 #include <time.h>
 #include <unistd.h>
+#include <math.h>
 #include <string>
 
 #include "acceptor.h"
@@ -116,7 +117,9 @@ UDPInput::UDPInput(const string &url)
        stats.url = url;
        stats.bytes_received = 0;
        stats.data_bytes_received = 0;
+       stats.metadata_bytes_received = 0;
        stats.connect_time = time(NULL);
+       stats.latency_sec = HUGE_VAL;
 }
 
 UDPInput::UDPInput(const InputProto &serialized)
@@ -226,7 +229,7 @@ void UDPInput::do_work()
                }
                
                for (size_t i = 0; i < stream_indices.size(); ++i) {
-                       servers->add_data(stream_indices[i], packet_buf, ret, SUITABLE_FOR_STREAM_START);
+                       servers->add_data(stream_indices[i], packet_buf, ret, /*metacube_flags=*/0);
                }
        }
 }