Skip to content

Commit

Permalink
fixup! http_server/health: Implement throughput health check
Browse files Browse the repository at this point in the history
Address Leonardo review: Check for throughput inside `is_healthy()`
function.

Signed-off-by: Thiago Padilha <[email protected]>
  • Loading branch information
tchrono committed Jul 22, 2022
1 parent 6240604 commit 4731593
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/http_server/api/v1/health.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static int is_healthy() {
}

if (mk_list_is_empty(metrics_list) == 0) {
return FLB_TRUE;
return FLB_TRUE && throughput_check_state.healthy;
}

/* Get the error metrics entry from the start time of current period */
Expand Down Expand Up @@ -182,7 +182,7 @@ static int is_healthy() {
return FLB_FALSE;
}

return FLB_TRUE;
return FLB_TRUE && throughput_check_state.healthy;
}

/* read the metrics from message queue and update the counter*/
Expand Down Expand Up @@ -480,7 +480,7 @@ static void cb_mq_health(mk_mq_t *queue, void *data, size_t size)
/* API: Get fluent Bit Health Status */
static void cb_health(mk_request_t *request, void *data)
{
int status = is_healthy() && throughput_check_state.healthy;
int status = is_healthy();

if (status == FLB_TRUE) {
mk_http_status(request, 200);
Expand Down

0 comments on commit 4731593

Please sign in to comment.