diff options
author | Harald Welte <laforge@netfilter.org> | 2009-12-22 19:07:32 +0100 |
---|---|---|
committer | Harald Welte <laforge@netfilter.org> | 2009-12-22 20:42:40 +0100 |
commit | ffa55a4e8783419f60932ef2f9e872293cf932b9 (patch) | |
tree | c615771fe04a89807a012d8e100de53847b70d0f /openbsc/src/abis_rsl.c | |
parent | 4983921af1a84ea20c6be7944bf0ff4928578a69 (diff) |
statistics: Introduce 'struct counter' instead of using unsigned long
This has the advantage that counters can be added all over the code
very easily, while having only one routine that stores all of the
current counter values to the database. The counters are synced
every 60 seconds, providing relatively fine grained statistics
about the network usage as time passes by.
Diffstat (limited to 'openbsc/src/abis_rsl.c')
-rw-r--r-- | openbsc/src/abis_rsl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c index ae1d6af5d..787a8038b 100644 --- a/openbsc/src/abis_rsl.c +++ b/openbsc/src/abis_rsl.c @@ -1261,14 +1261,14 @@ static int rsl_rx_chan_rqd(struct msgb *msg) lctype = get_ctype_by_chreq(bts, rqd_ref->ra, bts->network->neci); chreq_reason = get_reason_by_chreq(bts, rqd_ref->ra, bts->network->neci); - bts->network->stats.chreq.total++; + counter_inc(bts->network->stats.chreq.total); /* check availability / allocate channel */ lchan = lchan_alloc(bts, lctype); if (!lchan) { DEBUGP(DRSL, "CHAN RQD: no resources for %s 0x%x\n", gsm_lchan_name(lctype), rqd_ref->ra); - bts->network->stats.chreq.no_channel++; + counter_inc(bts->network->stats.chreq.no_channel); /* FIXME: send some kind of reject ?!? */ return -ENOMEM; } |