mgcp_ratectr: add stats items to monitor trunk usage
We are currently counting events in rate counters, but there is
currently no way to get a sample of the current situation of the trunk
usage. In particular how many endpoints are currently in use.
Change-Id: Ib7b654168dc3512f55e45cc4755dc1f6f423d023
Related: SYS#5535
diff --git a/include/osmocom/mgcp/mgcp_ratectr.h b/include/osmocom/mgcp/mgcp_ratectr.h
index 78c687b..0bd6f88 100644
--- a/include/osmocom/mgcp/mgcp_ratectr.h
+++ b/include/osmocom/mgcp/mgcp_ratectr.h
@@ -95,3 +95,17 @@
int mgcp_ratectr_global_alloc(struct mgcp_config *cfg);
int mgcp_ratectr_trunk_alloc(struct mgcp_trunk *trunk);
+
+/* Trunk-global common stat items */
+enum {
+ TRUNK_STAT_ENDPOINTS_TOTAL,
+ TRUNK_STAT_ENDPOINTS_USED,
+};
+
+struct mgcp_stat_trunk {
+ /* Stat item group which contains general status values of the trunk. */
+ struct osmo_stat_item_group *common;
+};
+
+int mgcp_stat_trunk_alloc(struct mgcp_trunk *trunk);
+