mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-07 07:42:49 -04:00
MINOR: server: central update for server counters on state change
Based on "BUG/MINOR: server: don't miss server stats update on server state transitions", we're also taking advantage of the new centralized logic to update down_trans server counter directly from there instead of multiple places.
This commit is contained in:
parent
9c21ff0208
commit
5f80f8bbc5
1 changed files with 4 additions and 2 deletions
|
|
@ -5335,7 +5335,6 @@ static void srv_update_status(struct server *s)
|
|||
free_trash_chunk(tmptrash);
|
||||
tmptrash = NULL;
|
||||
}
|
||||
s->counters.down_trans++;
|
||||
}
|
||||
else if ((s->cur_state != SRV_ST_STOPPING) && (s->next_state == SRV_ST_STOPPING)) {
|
||||
if (s->proxy->lbprm.set_server_status_down)
|
||||
|
|
@ -5503,7 +5502,6 @@ static void srv_update_status(struct server *s)
|
|||
free_trash_chunk(tmptrash);
|
||||
tmptrash = NULL;
|
||||
}
|
||||
s->counters.down_trans++;
|
||||
}
|
||||
}
|
||||
else if ((s->cur_admin & SRV_ADMF_MAINT) && !(s->next_admin & SRV_ADMF_MAINT)) {
|
||||
|
|
@ -5788,6 +5786,10 @@ static void srv_update_status(struct server *s)
|
|||
if (s->last_change < now.tv_sec) // ignore negative times
|
||||
s->down_time += now.tv_sec - s->last_change;
|
||||
}
|
||||
else if (s->cur_state == SRV_ST_STOPPED) {
|
||||
/* server was up and is currently down */
|
||||
s->counters.down_trans++;
|
||||
}
|
||||
s->last_change = now.tv_sec;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue