File tree Expand file tree Collapse file tree 2 files changed +33
-29
lines changed Expand file tree Collapse file tree 2 files changed +33
-29
lines changed Original file line number Diff line number Diff line change 3030
3131#include "health.h"
3232
33- /*
34- * in/out records sample at a certain timestamp.
35- */
36- struct flb_hs_throughput_sample {
37- uint64_t in_records ;
38- uint64_t out_records ;
39- uint64_t timestamp_seconds ;
40- };
41-
42- /* ring buffer + helper functions for storing samples */
43- struct flb_hs_throughput_samples {
44- struct flb_hs_throughput_sample * items ;
45- int size ;
46- int count ;
47- int insert ;
48- };
33+ struct flb_hs_throughput_state throughput_check_state = {0 };
34+
35+ struct flb_health_check_metrics_counter * metrics_counter ;
36+
37+ pthread_key_t hs_health_key ;
4938
5039static struct flb_hs_throughput_sample * samples_add (
5140 struct flb_hs_throughput_samples * samples )
@@ -81,19 +70,6 @@ static struct flb_hs_throughput_sample *samples_get(
8170 return samples -> items + real_index ;
8271}
8372
84- struct {
85- int enabled ;
86- struct mk_list * input_plugins ;
87- struct mk_list * output_plugins ;
88- double out_in_ratio_threshold ;
89-
90- struct flb_hs_throughput_samples samples ;
91- bool healthy ;
92- } throughput_check_state = {0 };
93-
94- struct flb_health_check_metrics_counter * metrics_counter ;
95-
96- pthread_key_t hs_health_key ;
9773
9874static struct mk_list * hs_health_key_create ()
9975{
Original file line number Diff line number Diff line change @@ -65,6 +65,34 @@ struct flb_hs_hc_buf {
6565 struct mk_list _head ;
6666};
6767
68+ /*
69+ * in/out records sample at a certain timestamp.
70+ */
71+ struct flb_hs_throughput_sample {
72+ uint64_t in_records ;
73+ uint64_t out_records ;
74+ uint64_t timestamp_seconds ;
75+ };
76+
77+ /* ring buffer + helper functions for storing samples */
78+ struct flb_hs_throughput_samples {
79+ struct flb_hs_throughput_sample * items ;
80+ int size ;
81+ int count ;
82+ int insert ;
83+ };
84+
85+ /* throughput health check state */
86+ struct flb_hs_throughput_state {
87+ int enabled ;
88+ struct mk_list * input_plugins ;
89+ struct mk_list * output_plugins ;
90+ double out_in_ratio_threshold ;
91+
92+ struct flb_hs_throughput_samples samples ;
93+ int healthy ;
94+ };
95+
6896/* health endpoint*/
6997int api_v1_health (struct flb_hs * hs );
7098
You can’t perform that action at this time.
0 commit comments