Add counter for socket unit refuse events (#9217)
core: add counter for socket unit rejection events
This commit is contained in:
committed by
Lennart Poettering
parent
c602fd0f19
commit
a98f7575ae
@@ -3890,6 +3890,7 @@ typedef struct UnitStatusInfo {
|
||||
/* Socket */
|
||||
unsigned n_accepted;
|
||||
unsigned n_connections;
|
||||
unsigned n_refused;
|
||||
bool accept;
|
||||
|
||||
/* Pairs of type, path */
|
||||
@@ -4155,8 +4156,13 @@ static void print_status_info(
|
||||
STRV_FOREACH_PAIR(t, t2, i->listen)
|
||||
printf(" %*s %s (%s)\n", 9, t == i->listen ? "Listen:" : "", *t2, *t);
|
||||
|
||||
if (i->accept)
|
||||
printf(" Accepted: %u; Connected: %u\n", i->n_accepted, i->n_connections);
|
||||
if (i->accept) {
|
||||
printf(" Accepted: %u; Connected: %u;", i->n_accepted, i->n_connections);
|
||||
if (i->n_refused)
|
||||
printf(" Refused: %u", i->n_refused);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
LIST_FOREACH(exec, p, i->exec) {
|
||||
_cleanup_free_ char *argv = NULL;
|
||||
@@ -4956,6 +4962,7 @@ static int show_one(
|
||||
{ "NextElapseUSecMonotonic", "t", NULL, offsetof(UnitStatusInfo, next_elapse_monotonic) },
|
||||
{ "NAccepted", "u", NULL, offsetof(UnitStatusInfo, n_accepted) },
|
||||
{ "NConnections", "u", NULL, offsetof(UnitStatusInfo, n_connections) },
|
||||
{ "NRefused", "u", NULL, offsetof(UnitStatusInfo, n_refused) },
|
||||
{ "Accept", "b", NULL, offsetof(UnitStatusInfo, accept) },
|
||||
{ "Listen", "a(ss)", map_listen, offsetof(UnitStatusInfo, listen) },
|
||||
{ "SysFSPath", "s", NULL, offsetof(UnitStatusInfo, sysfs_path) },
|
||||
|
||||
Reference in New Issue
Block a user