MINOR: backend: use be_counters for health down accounting
This commit is the first one of a series which aims to align counters usage between frontends/listeners on one side and backends/servers on the other. Remove <down_trans> field from proxy structure. Use instead the same name field from be_counters structure, which is already used for servers.
This commit is contained in:
parent
7556e5b3a4
commit
93066be32d
@ -365,7 +365,6 @@ struct proxy {
|
|||||||
int conn_retries; /* maximum number of connect retries */
|
int conn_retries; /* maximum number of connect retries */
|
||||||
unsigned int retry_type; /* Type of retry allowed */
|
unsigned int retry_type; /* Type of retry allowed */
|
||||||
int redispatch_after; /* number of retries before redispatch */
|
int redispatch_after; /* number of retries before redispatch */
|
||||||
unsigned down_trans; /* up-down transitions */
|
|
||||||
unsigned down_time; /* total time the proxy was down */
|
unsigned down_time; /* total time the proxy was down */
|
||||||
time_t last_change; /* last time, when the state was changed */
|
time_t last_change; /* last time, when the state was changed */
|
||||||
int (*accept)(struct stream *s); /* application layer's accept() */
|
int (*accept)(struct stream *s); /* application layer's accept() */
|
||||||
|
@ -2567,7 +2567,7 @@ void back_handle_st_rdy(struct stream *s)
|
|||||||
void set_backend_down(struct proxy *be)
|
void set_backend_down(struct proxy *be)
|
||||||
{
|
{
|
||||||
be->last_change = ns_to_sec(now_ns);
|
be->last_change = ns_to_sec(now_ns);
|
||||||
_HA_ATOMIC_INC(&be->down_trans);
|
_HA_ATOMIC_INC(&be->be_counters.down_trans);
|
||||||
|
|
||||||
if (!(global.mode & MODE_STARTING)) {
|
if (!(global.mode & MODE_STARTING)) {
|
||||||
ha_alert("%s '%s' has no server available!\n", proxy_type_str(be), be->id);
|
ha_alert("%s '%s' has no server available!\n", proxy_type_str(be), be->id);
|
||||||
|
@ -1710,7 +1710,7 @@ int stats_fill_be_stats(struct proxy *px, int flags, struct field *stats, int le
|
|||||||
metric = mkf_u32(0, px->srv_bck);
|
metric = mkf_u32(0, px->srv_bck);
|
||||||
break;
|
break;
|
||||||
case ST_F_CHKDOWN:
|
case ST_F_CHKDOWN:
|
||||||
metric = mkf_u64(FN_COUNTER, px->down_trans);
|
metric = mkf_u64(FN_COUNTER, px->be_counters.down_trans);
|
||||||
break;
|
break;
|
||||||
case ST_F_LASTCHG:
|
case ST_F_LASTCHG:
|
||||||
metric = mkf_u32(FN_AGE, ns_to_sec(now_ns) - px->last_change);
|
metric = mkf_u32(FN_AGE, ns_to_sec(now_ns) - px->last_change);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user