Commit 74ae3eb8 authored by Geoff Simmons's avatar Geoff Simmons

MQ plugin for Kafka: stats are all unsigned long

parent 4e034900
......@@ -40,12 +40,13 @@
static pthread_t monitor;
static int run = 0;
static unsigned seen, produced, delivered, failed, nokey, badkey, nodata;
static unsigned long seen, produced, delivered, failed, nokey, badkey, nodata;
/* Call rd_kafka_poll() for each worker to provoke callbacks */
static void
poll_workers(void)
{
seen = produced = delivered = failed = nokey = badkey = nodata = 0;
for (int i = 0; i < nwrk; i++)
if (workers[i] != NULL) {
kafka_wrk_t *wrk = workers[i];
......@@ -103,7 +104,6 @@ static void
pthread_exit(&err);
}
}
seen = produced = delivered = failed = nokey = badkey = nodata = 0;
poll_workers();
MQ_LOG_Log(LOG_INFO, "mq stats summary: seen=%u produced=%u "
"delivered=%u failed=%u nokey=%u badkey=%u nodata=%u",
......
......@@ -46,13 +46,13 @@ typedef struct kafka_wrk {
int err;
char reason[LINE_MAX]; /* errs from rdkafka callbacks */
char errmsg[LINE_MAX]; /* thread-safe return from MQ_*() */
unsigned seen;
unsigned produced;
unsigned delivered;
unsigned failed;
unsigned nokey;
unsigned badkey;
unsigned nodata;
unsigned long seen;
unsigned long produced;
unsigned long delivered;
unsigned long failed;
unsigned long nokey;
unsigned long badkey;
unsigned long nodata;
} kafka_wrk_t;
kafka_wrk_t **workers;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment