keep some internal statistics inside OpenBSC
the statistics will give us some idea about the network load and
performance.
diff --git a/openbsc/src/handover_logic.c b/openbsc/src/handover_logic.c
index 94d3d0d..393b0f2 100644
--- a/openbsc/src/handover_logic.c
+++ b/openbsc/src/handover_logic.c
@@ -97,9 +97,12 @@
DEBUGP(DHO, "(old_lchan on BTS %u, new BTS %u)\n",
old_lchan->ts->trx->bts->nr, bts->nr);
+ bts->network->stats.handover.attempted++;
+
new_lchan = lchan_alloc(bts, old_lchan->type);
if (!new_lchan) {
LOGP(DHO, LOGL_NOTICE, "No free channel\n");
+ bts->network->stats.handover.no_channel++;
return -ENOSPC;
}
@@ -143,6 +146,7 @@
struct bsc_handover *ho = _ho;
DEBUGP(DHO, "HO T3103 expired\n");
+ ho->new_lchan->ts->trx->bts->network->stats.handover.timeout++;
lchan_free(ho->new_lchan);
llist_del(&ho->list);
@@ -211,6 +215,8 @@
return -ENODEV;
}
+ new_lchan->ts->trx->bts->network->stats.handover.completed++;
+
bsc_del_timer(&ho->T3103);
/* update lchan pointer of transaction */
@@ -238,6 +244,8 @@
return -ENODEV;
}
+ old_lchan->ts->trx->bts->network->stats.handover.failed++;
+
bsc_del_timer(&ho->T3103);
llist_del(&ho->list);
put_lchan(ho->new_lchan);