extern int actconn; /* # of active sessions */
extern int listeners;
extern int jobs; /* # of active jobs (listeners, sessions, open devices) */
+extern int active_peers; /* # of active peers (connection attempts and successes) */
extern THREAD_LOCAL struct buffer trash;
extern int nb_oldpids; /* contains the number of old pids found */
extern const int zero;
INF_STOPPING,
INF_JOBS,
INF_LISTENERS,
+ INF_ACTIVE_PEERS,
/* must always be the last one */
INF_TOTAL_FIELDS
int stopping; /* non zero means stopping in progress */
int killed; /* non zero means a hard-stop is triggered */
int jobs = 0; /* number of active jobs (conns, listeners, active tasks, ...) */
+int active_peers = 0; /* number of active peers (connection attempts and connected) */
/* Here we store informations about the pids of the processes we may pause
* or kill. We will send them a signal every 10 ms until we can bind to all
/* peer session identified */
if (peer) {
+ HA_ATOMIC_SUB(&active_peers, 1);
HA_SPIN_LOCK(PEER_LOCK, &peer->lock);
if (peer->appctx == appctx) {
/* Re-init current table pointers to force announcement on re-connect */
curpeer->appctx = appctx;
appctx->ctx.peers.ptr = curpeer;
appctx->st0 = PEER_SESS_ST_SENDSUCCESS;
+ HA_ATOMIC_ADD(&active_peers, 1);
/* fall through */
}
case PEER_SESS_ST_SENDSUCCESS: {
peer->appctx = appctx;
task_wakeup(s->task, TASK_WOKEN_INIT);
+ HA_ATOMIC_ADD(&active_peers, 1);
return appctx;
/* Error unrolling */
[INF_STOPPING] = "Stopping",
[INF_JOBS] = "Jobs",
[INF_LISTENERS] = "Listeners",
+ [INF_ACTIVE_PEERS] = "ActivePeers",
};
const char *stat_field_names[ST_F_TOTAL_FIELDS] = {
info[INF_STOPPING] = mkf_u32(0, stopping);
info[INF_JOBS] = mkf_u32(0, jobs);
info[INF_LISTENERS] = mkf_u32(0, listeners);
+ info[INF_ACTIVE_PEERS] = mkf_u32(0, active_peers);
return 1;
}