From 4731593514fd1511912f5b62ac9f13baf59c8eaa Mon Sep 17 00:00:00 2001 From: Thiago Padilha Date: Fri, 22 Jul 2022 10:47:26 -0300 Subject: [PATCH] fixup! http_server/health: Implement throughput health check Address Leonardo review: Check for throughput inside `is_healthy()` function. Signed-off-by: Thiago Padilha --- src/http_server/api/v1/health.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/http_server/api/v1/health.c b/src/http_server/api/v1/health.c index 1baefc30c55..69b6eb0fe63 100644 --- a/src/http_server/api/v1/health.c +++ b/src/http_server/api/v1/health.c @@ -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 */ @@ -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*/ @@ -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);