Skip to content

Commit

Permalink
Info messages showing current rate
Browse files Browse the repository at this point in the history
  • Loading branch information
onorua committed Nov 28, 2017
1 parent bf8310d commit b44f747
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/filter_throttle/throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit b44f747

Please sign in to comment.