diff --git a/include/types/counters.h b/include/types/counters.h index 189854874..97df045e3 100644 --- a/include/types/counters.h +++ b/include/types/counters.h @@ -100,6 +100,7 @@ struct be_counters { long long down_trans; /* up->down transitions */ unsigned int q_time, c_time, d_time, t_time; /* sums of conn_time, queue_time, data_time, total_time */ + unsigned int qtime_max, ctime_max, dtime_max, ttime_max; /* maximum of conn_time, queue_time, data_time, total_time observed */ union { struct { diff --git a/src/stats.c b/src/stats.c index cf692dafd..c68ab63e7 100644 --- a/src/stats.c +++ b/src/stats.c @@ -3746,6 +3746,10 @@ static int cli_parse_clear_counters(char **args, char *payload, struct appctx *a px->be_counters.sps_max = 0; px->be_counters.cps_max = 0; px->be_counters.nbpend_max = 0; + px->be_counters.qtime_max = 0; + px->be_counters.ctime_max = 0; + px->be_counters.dtime_max = 0; + px->be_counters.ttime_max = 0; px->fe_counters.conn_max = 0; px->fe_counters.p.http.rps_max = 0; @@ -3760,6 +3764,10 @@ static int cli_parse_clear_counters(char **args, char *payload, struct appctx *a sv->counters.cur_sess_max = 0; sv->counters.nbpend_max = 0; sv->counters.sps_max = 0; + sv->counters.qtime_max = 0; + sv->counters.ctime_max = 0; + sv->counters.dtime_max = 0; + sv->counters.ttime_max = 0; } list_for_each_entry(li, &px->conf.listeners, by_fe) diff --git a/src/stream.c b/src/stream.c index 58ebab6ab..2c0d2c895 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2956,11 +2956,19 @@ void stream_update_time_stats(struct stream *s) swrate_add(&srv->counters.c_time, TIME_STATS_SAMPLES, t_connect); swrate_add(&srv->counters.d_time, TIME_STATS_SAMPLES, t_data); swrate_add(&srv->counters.t_time, TIME_STATS_SAMPLES, t_close); + HA_ATOMIC_UPDATE_MAX(&srv->counters.qtime_max, t_queue); + HA_ATOMIC_UPDATE_MAX(&srv->counters.ctime_max, t_connect); + HA_ATOMIC_UPDATE_MAX(&srv->counters.dtime_max, t_data); + HA_ATOMIC_UPDATE_MAX(&srv->counters.ttime_max, t_close); } swrate_add(&s->be->be_counters.q_time, TIME_STATS_SAMPLES, t_queue); swrate_add(&s->be->be_counters.c_time, TIME_STATS_SAMPLES, t_connect); swrate_add(&s->be->be_counters.d_time, TIME_STATS_SAMPLES, t_data); swrate_add(&s->be->be_counters.t_time, TIME_STATS_SAMPLES, t_close); + HA_ATOMIC_UPDATE_MAX(&s->be->be_counters.qtime_max, t_queue); + HA_ATOMIC_UPDATE_MAX(&s->be->be_counters.ctime_max, t_connect); + HA_ATOMIC_UPDATE_MAX(&s->be->be_counters.dtime_max, t_data); + HA_ATOMIC_UPDATE_MAX(&s->be->be_counters.ttime_max, t_close); } /*