From b44f747b412fdee870b61da48be20ff18662d523 Mon Sep 17 00:00:00 2001 From: Yaroslav Molochko Date: Fri, 17 Nov 2017 23:58:48 +0200 Subject: [PATCH] Info messages showing current rate --- plugins/filter_throttle/throttle.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/filter_throttle/throttle.c b/plugins/filter_throttle/throttle.c index 1f9dfbd418d..4a0ac044338 100644 --- a/plugins/filter_throttle/throttle.c +++ b/plugins/filter_throttle/throttle.c @@ -41,18 +41,18 @@ struct ticker { void *time_ticker(void *args) { - struct ticker *t_ctx = args; + struct ticker *t = args; struct flb_time ftm; long timestamp; - while (!t_ctx->done) { + while (!t->done) { flb_time_get(&ftm); timestamp = flb_time_to_double(&ftm); - window_add(t_ctx->ctx->hash, timestamp, 0); + window_add(t->ctx->hash, timestamp, 0); - t_ctx->ctx->hash->current_timestamp = timestamp; + t->ctx->hash->current_timestamp = timestamp; - flb_error("current time is: %i", timestamp); + flb_info("[filter_throttle] %i: limist is %f per sec in window %i sec, current rate is: %i per sec", timestamp, t->ctx->max_rate, t->ctx->window_size, t->ctx->hash->total / t->ctx->hash->size); sleep(1); } }