Skip to content

Commit

Permalink
fix: only calculate speed when interval > 0
Browse files Browse the repository at this point in the history
Signed-off-by: composer <[email protected]>
  • Loading branch information
joker-star-l committed Oct 31, 2024
1 parent 14f2526 commit affcdc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/out_doris/doris.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static void cb_doris_flush(struct flb_event_chunk *event_chunk,
&out_body, &out_size);

if (ret != FLB_OK) {
if (ret == FLB_ERROR) {
if (ret == FLB_ERROR && ctx->log_progress_interval > 0) {
__sync_fetch_and_add(&ctx->reporter->failed_rows, event_chunk->total_events);
}
FLB_OUTPUT_RETURN(ret);
Expand All @@ -328,10 +328,10 @@ static void cb_doris_flush(struct flb_event_chunk *event_chunk,
event_chunk->tag, flb_sds_len(event_chunk->tag), label, len);
flb_sds_destroy(out_body);

if (ret == FLB_OK) {
if (ret == FLB_OK && ctx->log_progress_interval > 0) {
__sync_fetch_and_add(&ctx->reporter->total_bytes, out_size);
__sync_fetch_and_add(&ctx->reporter->total_rows, event_chunk->total_events);
} else if (ret == FLB_ERROR) {
} else if (ret == FLB_ERROR && ctx->log_progress_interval > 0) {
__sync_fetch_and_add(&ctx->reporter->failed_rows, event_chunk->total_events);
}
FLB_OUTPUT_RETURN(ret);
Expand Down

0 comments on commit affcdc5

Please sign in to comment.