aboutsummaryrefslogtreecommitdiffstats
path: root/src/bts.h
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-27 09:02:31 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-30 21:24:12 +0100
commitf537298ccad65dfb64076c5a68895eb93743c432 (patch)
treef3d9e5da32c0239c13fff3a90eca5d6902d7a723 /src/bts.h
parent61a0a04d2651211715dc5e379021da334606c229 (diff)
bts: Start creating statistics inside the BTS code
Diffstat (limited to 'src/bts.h')
-rw-r--r--src/bts.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/bts.h b/src/bts.h
index f1df398b..af51e471 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -24,6 +24,7 @@
#ifdef __cplusplus
extern "C" {
#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/timer.h>
}
@@ -147,7 +148,16 @@ struct gprs_rlcmac_bts {
*/
struct BTS {
public:
+ enum {
+ CTR_TBF_DL_ALLOCATED,
+ CTR_TBF_DL_FREED,
+ CTR_TBF_UL_ALLOCATED,
+ CTR_TBF_UL_FREED,
+ CTR_DECODE_ERRORS,
+ };
+
BTS();
+ ~BTS();
static BTS* main_bts();
@@ -174,12 +184,27 @@ public:
void trigger_dl_ass(gprs_rlcmac_tbf *tbf, gprs_rlcmac_tbf *old_tbf, const char *imsi);
void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi);
+ /*
+ * Statistics
+ */
+ void tbf_dl_created();
+ void tbf_dl_freed();
+ void tbf_ul_created();
+ void tbf_ul_freed();
+ void decode_error();
+
+ /*
+ * Below for C interface for the VTY
+ */
+ struct rate_ctr_group *rate_counters() const;
+
private:
int m_cur_fn;
struct gprs_rlcmac_bts m_bts;
PollController m_pollController;
SBAController m_sba;
TimingAdvance m_ta;
+ struct rate_ctr_group *m_ratectrs;
private:
/* disable copying to avoid slicing */
@@ -207,6 +232,11 @@ inline BTS *gprs_rlcmac_pdch::bts() const
return trx->bts;
}
+inline struct rate_ctr_group *BTS::rate_counters() const
+{
+ return m_ratectrs;
+}
+
inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const
{
return trx->bts->bts_data();
@@ -222,6 +252,7 @@ inline uint8_t gprs_rlcmac_pdch::trx_no() const
extern "C" {
#endif
struct gprs_rlcmac_bts *bts_main_data();
+ struct rate_ctr_group *bts_main_data_stats();
#ifdef __cplusplus
}