diff options
author | Harald Welte <laforge@osmocom.org> | 2022-04-20 12:37:44 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2022-04-20 21:32:20 +0200 |
commit | 1e620fb491b3207de1abae066957f7b9acbedec8 (patch) | |
tree | 9426714ac9e019482c64a567efa9e297c0590cb2 /src | |
parent | 916afa447688b6d7a9ebecf8b2b0e39e4ffdfbfa (diff) |
e1oip: Add stat items for number of timeslots
This adds "e1oip:e1t_ts_active" and "e1oip:e1o_ts_active" to show
which timeslots are active (i.e. which are transmitting data in the
IP protocol).
Change-Id: I6858e0773a348193bb4839c247294cef5ab4df5f
Diffstat (limited to 'src')
-rw-r--r-- | src/octoi/e1oip.c | 4 | ||||
-rw-r--r-- | src/octoi/e1oip.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/octoi/e1oip.c b/src/octoi/e1oip.c index cf04c9a..87457db 100644 --- a/src/octoi/e1oip.c +++ b/src/octoi/e1oip.c @@ -65,6 +65,8 @@ static const struct osmo_stat_item_desc iline_stat_description[] = { [LINE_STAT_E1oIP_RTT] = { "e1oip:rtt", "Round Trip Time (in ms)" }, [LINE_STAT_E1oIP_E1O_FIFO] = { "e1oip:e1o_fifo_level", "E1 originated FIFO level" }, [LINE_STAT_E1oIP_E1T_FIFO] = { "e1oip:e1t_fifo_level", "E1 terminated FIFO level" }, + [LINE_STAT_E1oIP_E1O_TS] = { "e1oip:e1o_ts_active", "E1 timeslots active in E1->IP direction" }, + [LINE_STAT_E1oIP_E1T_TS] = { "e1oip:e1t_ts_active", "E1 timeslots active in IP->E1 direction" }, }; static const struct osmo_stat_item_group_desc iline_stats_desc = { @@ -126,6 +128,7 @@ static void fifo_threshold_cb(struct frame_fifo *fifo, unsigned int frames, void if (ts_mask & (1U << i)) num_ts++; } + iline_stat_set(iline, LINE_STAT_E1oIP_E1O_TS, num_ts); /* finally, encode the payload */ if (num_ts == 0) { @@ -228,6 +231,7 @@ int e1oip_rcvmsg_tdm_data(struct e1oip_line *iline, struct msgb *msg) /* compute E1oIP idx to timeslot table */ num_ts = ts_mask2idx(idx2ts, ts_mask); + iline_stat_set(iline, LINE_STAT_E1oIP_E1T_TS, num_ts); if (num_ts > 0) { n_frames = msgb_l3len(msg) / num_ts; if (msgb_l3len(msg) % num_ts) { diff --git a/src/octoi/e1oip.h b/src/octoi/e1oip.h index b643b5a..3c5a478 100644 --- a/src/octoi/e1oip.h +++ b/src/octoi/e1oip.h @@ -29,6 +29,8 @@ enum e1oip_line_stat { LINE_STAT_E1oIP_RTT, LINE_STAT_E1oIP_E1O_FIFO, LINE_STAT_E1oIP_E1T_FIFO, + LINE_STAT_E1oIP_E1O_TS, + LINE_STAT_E1oIP_E1T_TS, }; struct octoi_peer; |