summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_cmd.c7
-rw-r--r--pimd/pim_iface.h1
-rw-r--r--pimd/pim_igmp.c5
-rw-r--r--pimd/pim_igmp_stats.c1
-rw-r--r--pimd/pim_igmp_stats.h1
-rw-r--r--pimd/pim_pim.c1
6 files changed, 16 insertions, 0 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 78dbbf932..0d24f51ef 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -1309,6 +1309,8 @@ static void igmp_show_statistics(struct pim_instance *pim, struct vty *vty,
pim_ifp->gm_group_list
? listcount(pim_ifp->gm_group_list)
: 0;
+ igmp_stats.peak_groups += pim_ifp->igmp_peak_group_count;
+
for (ALL_LIST_ELEMENTS_RO(pim_ifp->gm_group_list, group_node,
group)) {
@@ -1350,6 +1352,8 @@ static void igmp_show_statistics(struct pim_instance *pim, struct vty *vty,
igmp_stats.unsupported);
json_object_int_add(json_row, "totalReceivedMessages",
igmp_stats.total_recv_messages);
+ json_object_int_add(json_row, "peakGroups",
+ igmp_stats.peak_groups);
json_object_int_add(json_row, "totalGroups",
igmp_stats.total_groups);
json_object_int_add(json_row, "totalSourceGroups",
@@ -1399,6 +1403,8 @@ static void igmp_show_statistics(struct pim_instance *pim, struct vty *vty,
igmp_stats.general_queries_sent);
vty_out(vty, "group queries sent : %u\n",
igmp_stats.group_queries_sent);
+ vty_out(vty, "peak groups : %u\n",
+ igmp_stats.peak_groups);
vty_out(vty, "total groups : %u\n",
igmp_stats.total_groups);
vty_out(vty, "total source groups : %u\n",
@@ -4051,6 +4057,7 @@ DEFUN (clear_ip_pim_interface_traffic,
pim_ifp->pim_ifstat_bsm_tx = 0;
pim_ifp->igmp_ifstat_joins_sent = 0;
pim_ifp->igmp_ifstat_joins_failed = 0;
+ pim_ifp->igmp_peak_group_count = 0;
}
return CMD_SUCCESS;
diff --git a/pimd/pim_iface.h b/pimd/pim_iface.h
index 244e1aedd..bab73eae8 100644
--- a/pimd/pim_iface.h
+++ b/pimd/pim_iface.h
@@ -191,6 +191,7 @@ struct pim_interface {
uint32_t igmp_ifstat_joins_sent;
uint32_t igmp_ifstat_joins_failed;
+ uint32_t igmp_peak_group_count;
struct {
bool enabled;
diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c
index cfab9265f..aa6b30c62 100644
--- a/pimd/pim_igmp.c
+++ b/pimd/pim_igmp.c
@@ -977,6 +977,8 @@ static void igmp_group_free(struct gm_group *group)
static void igmp_group_count_incr(struct pim_interface *pim_ifp)
{
+ uint32_t group_count = listcount(pim_ifp->gm_group_list);
+
++pim_ifp->pim->igmp_group_count;
if (pim_ifp->pim->igmp_group_count
== pim_ifp->pim->igmp_watermark_limit) {
@@ -985,6 +987,9 @@ static void igmp_group_count_incr(struct pim_interface *pim_ifp)
pim_ifp->pim->igmp_group_count,
VRF_LOGNAME(pim_ifp->pim->vrf));
}
+
+ if (pim_ifp->igmp_peak_group_count < group_count)
+ pim_ifp->igmp_peak_group_count = group_count;
}
static void igmp_group_count_decr(struct pim_interface *pim_ifp)
diff --git a/pimd/pim_igmp_stats.c b/pimd/pim_igmp_stats.c
index 6a5ce4dc8..1d5110468 100644
--- a/pimd/pim_igmp_stats.c
+++ b/pimd/pim_igmp_stats.c
@@ -43,6 +43,7 @@ void igmp_stats_add(struct igmp_stats *a, struct igmp_stats *b)
a->mtrace_rsp += b->mtrace_rsp;
a->mtrace_req += b->mtrace_req;
a->unsupported += b->unsupported;
+ a->peak_groups += b->peak_groups;
a->total_groups += b->total_groups;
a->total_source_groups += b->total_source_groups;
a->joins_sent += b->joins_sent;
diff --git a/pimd/pim_igmp_stats.h b/pimd/pim_igmp_stats.h
index 560132a19..8c66986e0 100644
--- a/pimd/pim_igmp_stats.h
+++ b/pimd/pim_igmp_stats.h
@@ -33,6 +33,7 @@ struct igmp_stats {
uint32_t mtrace_rsp;
uint32_t mtrace_req;
uint32_t unsupported;
+ uint32_t peak_groups;
uint32_t total_groups;
uint32_t total_source_groups;
uint32_t joins_sent;
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index 616cad16c..535448f01 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -469,6 +469,7 @@ void pim_ifstat_reset(struct interface *ifp)
pim_ifp->pim_ifstat_bsm_invalid_sz = 0;
pim_ifp->igmp_ifstat_joins_sent = 0;
pim_ifp->igmp_ifstat_joins_failed = 0;
+ pim_ifp->igmp_peak_group_count = 0;
}
void pim_sock_reset(struct interface *ifp)