File tree Expand file tree Collapse file tree 5 files changed +301
-16
lines changed Expand file tree Collapse file tree 5 files changed +301
-16
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,11 @@ struct flb_config {
171
171
int hc_errors_count ; /* health check error counts as unhealthy*/
172
172
int hc_retry_failure_count ; /* health check retry failures count as unhealthy*/
173
173
int health_check_period ; /* period by second for health status check */
174
+ int hc_throughput ; /* if throughput check is enabled */
175
+ char * hc_throughput_input_plugins ; /* which input plugins should be considered for checking throughput */
176
+ char * hc_throughput_output_plugins ;/* which output plugins should be considered for checking throughput */
177
+ double hc_throughput_ratio_threshold ; /* output/input ratio threshold to consider a failure */
178
+ int hc_throughput_min_failures ; /* minimum amount of failures to cause error condition */
174
179
#endif
175
180
176
181
/*
@@ -298,6 +303,11 @@ enum conf_type {
298
303
#define FLB_CONF_STR_HC_ERRORS_COUNT "HC_Errors_Count"
299
304
#define FLB_CONF_STR_HC_RETRIES_FAILURE_COUNT "HC_Retry_Failure_Count"
300
305
#define FLB_CONF_STR_HC_PERIOD "HC_Period"
306
+ #define FLB_CONF_STR_HC_THROUGHPUT "HC_Throughput"
307
+ #define FLB_CONF_STR_HC_THROUGHPUT_IN_PLUGINS "HC_Throughput_Input_Plugins"
308
+ #define FLB_CONF_STR_HC_THROUGHPUT_OUT_PLUGINS "HC_Throughput_Output_Plugins"
309
+ #define FLB_CONF_STR_HC_THROUGHPUT_RATIO_THRESHOLD "HC_Throughput_Ratio_Threshold"
310
+ #define FLB_CONF_STR_HC_THROUGHPUT_MIN_FAILURES "HC_Throughput_Min_Failures"
301
311
#endif /* !FLB_HAVE_HTTP_SERVER */
302
312
303
313
/* DNS */
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ int flb_time_get(struct flb_time *tm);
76
76
int flb_time_msleep (uint32_t ms );
77
77
double flb_time_to_double (struct flb_time * tm );
78
78
uint64_t flb_time_to_nanosec (struct flb_time * tm );
79
+ uint64_t flb_time_to_seconds (struct flb_time * tm );
79
80
int flb_time_add (struct flb_time * base , struct flb_time * duration ,
80
81
struct flb_time * result );
81
82
int flb_time_diff (struct flb_time * time1 ,
Original file line number Diff line number Diff line change @@ -106,6 +106,25 @@ struct flb_service_config service_configs[] = {
106
106
FLB_CONF_TYPE_INT ,
107
107
offsetof(struct flb_config , health_check_period )},
108
108
109
+ {FLB_CONF_STR_HC_THROUGHPUT ,
110
+ FLB_CONF_TYPE_BOOL ,
111
+ offsetof(struct flb_config , hc_throughput )},
112
+
113
+ {FLB_CONF_STR_HC_THROUGHPUT_IN_PLUGINS ,
114
+ FLB_CONF_TYPE_STR ,
115
+ offsetof(struct flb_config , hc_throughput_input_plugins )},
116
+
117
+ {FLB_CONF_STR_HC_THROUGHPUT_OUT_PLUGINS ,
118
+ FLB_CONF_TYPE_STR ,
119
+ offsetof(struct flb_config , hc_throughput_output_plugins )},
120
+
121
+ {FLB_CONF_STR_HC_THROUGHPUT_RATIO_THRESHOLD ,
122
+ FLB_CONF_TYPE_DOUBLE ,
123
+ offsetof(struct flb_config , hc_throughput_ratio_threshold )},
124
+
125
+ {FLB_CONF_STR_HC_THROUGHPUT_MIN_FAILURES ,
126
+ FLB_CONF_TYPE_INT ,
127
+ offsetof(struct flb_config , hc_throughput_min_failures )},
109
128
#endif
110
129
/* DNS*/
111
130
{FLB_CONF_DNS_MODE ,
Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ uint64_t flb_time_to_nanosec(struct flb_time *tm)
96
96
return (((uint64_t )tm -> tm .tv_sec * 1000000000L ) + tm -> tm .tv_nsec );
97
97
}
98
98
99
+ uint64_t flb_time_to_seconds (struct flb_time * tm )
100
+ {
101
+ return (uint64_t )tm -> tm .tv_sec ;
102
+ }
103
+
99
104
int flb_time_add (struct flb_time * base , struct flb_time * duration , struct flb_time * result )
100
105
{
101
106
if (base == NULL || duration == NULL || result == NULL ) {
You can’t perform that action at this time.
0 commit comments