brubeck
brubeck copied to clipboard
why not use res but SIM_PACKETS at statsd.c?
https://github.com/github/brubeck/blob/master/src/samplers/statsd.c#L56
for (i = 0; i < SIM_PACKETS; ++i) {
+1
+1
we are running brubeck on Ubuntu 14.04.
used config:
"samplers" : [ { "type" : "statsd", "address" : "0.0.0.0", "port" : 8126, "workers" : 4, "multisock" : true, "multimsg" : 8 }
note value for multimsg.
Had our log filled with:
instance=brubeck sampler=statsd event=packet_dropped
After we changed multimsg from 8 to 1 - errors stopped
please consider following code change as a fix to src/samplers/statsd.c:
@@ -51,9 +51,9 @@ static void statsd_run_recvmmsg(struct brubeck_statsd *statsd, int sock)
}
/* store stats */
- brubeck_atomic_add(&statsd->sampler.inflow, SIM_PACKETS);
+ brubeck_atomic_add(&statsd->sampler.inflow, res);
- for (i = 0; i < SIM_PACKETS; ++i) {
+ for (i = 0; i < res; ++i) {
char *buf = msgs[i].msg_hdr.msg_iov->iov_base;
char *end = buf + msgs[i].msg_len;
brubeck_statsd_packet_parse(server, buf, end);
note that this appears to be a duplicate of #42
is there plans to apply above fix?