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 30
30
31
31
#include "health.h"
32
32
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 ;
49
38
50
39
static struct flb_hs_throughput_sample * samples_add (
51
40
struct flb_hs_throughput_samples * samples )
@@ -81,19 +70,6 @@ static struct flb_hs_throughput_sample *samples_get(
81
70
return samples -> items + real_index ;
82
71
}
83
72
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 ;
97
73
98
74
static struct mk_list * hs_health_key_create ()
99
75
{
Original file line number Diff line number Diff line change @@ -65,6 +65,34 @@ struct flb_hs_hc_buf {
65
65
struct mk_list _head ;
66
66
};
67
67
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
+
68
96
/* health endpoint*/
69
97
int api_v1_health (struct flb_hs * hs );
70
98
You can’t perform that action at this time.
0 commit comments