Skip to content

Commit 4731593

Browse files
committed
fixup! http_server/health: Implement throughput health check
Address Leonardo review: Check for throughput inside `is_healthy()` function. Signed-off-by: Thiago Padilha <[email protected]>
1 parent 6240604 commit 4731593

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/http_server/api/v1/health.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static int is_healthy() {
154154
}
155155

156156
if (mk_list_is_empty(metrics_list) == 0) {
157-
return FLB_TRUE;
157+
return FLB_TRUE && throughput_check_state.healthy;
158158
}
159159

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

185-
return FLB_TRUE;
185+
return FLB_TRUE && throughput_check_state.healthy;
186186
}
187187

188188
/* 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)
480480
/* API: Get fluent Bit Health Status */
481481
static void cb_health(mk_request_t *request, void *data)
482482
{
483-
int status = is_healthy() && throughput_check_state.healthy;
483+
int status = is_healthy();
484484

485485
if (status == FLB_TRUE) {
486486
mk_http_status(request, 200);

0 commit comments

Comments
 (0)