Skip to content

Commit

Permalink
use actual number of received messages github#68
Browse files Browse the repository at this point in the history
  • Loading branch information
lukepalmer committed Nov 9, 2019
1 parent 35b3902 commit 24d0177
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/samplers/statsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 24d0177

Please sign in to comment.