Skip to content

Commit

Permalink
BaseStationStatsCollector: Emit some statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
a-andre committed Aug 4, 2022
1 parent 6b3595c commit 21f2895
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/corenetwork/statsCollector/BaseStationStatsCollector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ void BaseStationStatsCollector::initialize(int stage){
scheduleAt(NOW + tPutPeriod_,tPut_);
}
}

// statistics
dl_total_prb_ = registerSignal("DlTotalPRB");
ul_total_prb_ = registerSignal("UlTotalPRB");
num_ue_dl_nongbr_ = registerSignal("ActiveUsersDl");
num_ue_ul_nongbr_ = registerSignal("ActiveUsersUl");
}


Expand Down Expand Up @@ -293,27 +299,31 @@ void BaseStationStatsCollector::add_dl_total_prb_usage_cell()
{
double prb_usage = mac_->getUtilization(DL);
EV << collectorType_ << "::add_dl_total_prb_usage_cell " << prb_usage << "%"<< endl;
emit(dl_total_prb_, prb_usage);
dl_total_prb_usage_cell.addValue((int)prb_usage);
}

void BaseStationStatsCollector::add_ul_total_prb_usage_cell()
{
double prb_usage = mac_->getUtilization(UL);
EV << collectorType_ << "::add_ul_total_prb_usage_cell " << prb_usage << "%"<< endl;
emit(ul_total_prb_, prb_usage);
ul_total_prb_usage_cell.addValue((int)prb_usage);
}

void BaseStationStatsCollector::add_number_of_active_ue_dl_nongbr_cell()
{
int users = mac_->getActiveUesNumber(DL);
EV << collectorType_ << "::add_number_of_active_ue_dl_nongbr_cell " << users << endl;
emit(num_ue_dl_nongbr_, users);
number_of_active_ue_dl_nongbr_cell.addValue(users);
}

void BaseStationStatsCollector::add_number_of_active_ue_ul_nongbr_cell()
{
int users = mac_->getActiveUesNumber(UL);
EV << collectorType_ << "::add_number_of_active_ue_ul_nongbr_cell " << users << endl;
emit(num_ue_ul_nongbr_, users);
number_of_active_ue_ul_nongbr_cell.addValue(users);
}

Expand Down
7 changes: 5 additions & 2 deletions src/corenetwork/statsCollector/BaseStationStatsCollector.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ class BaseStationStatsCollector: public cSimpleModule
L2MeasBase dl_nongbr_pdr_cell;
L2MeasBase ul_nongbr_pdr_cell;

// TODO insert signals for oMNeT++ statistics

// statistics
omnetpp::simsignal_t dl_total_prb_;
omnetpp::simsignal_t ul_total_prb_;
omnetpp::simsignal_t num_ue_dl_nongbr_;
omnetpp::simsignal_t num_ue_ul_nongbr_;

/*
* timers:
Expand Down
11 changes: 11 additions & 0 deletions src/corenetwork/statsCollector/StatsCollectors.ned
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ module BaseStationStatsCollector like StatsCollector

@display("i=block/cogwheel");
@class("BaseStationStatsCollector");
@signal[DlTotalPRB];
@statistic[DlTotalPRB](title="Downlink total number of PRBs"; unit=""; source="DlTotalPRB"; record=vector);

@signal[UlTotalPRB];
@statistic[UlTotalPRB](title="Uplink total number of PRBs"; unit=""; source="UlTotalPRB"; record=vector);

@signal[ActiveUsersDl];
@statistic[ActiveUsersDl](title="Number of active users (downlink)"; unit=""; source="ActiveUsersDl"; record=vector);

@signal[ActiveUsersUl];
@statistic[ActiveUsersUl](title="Number of active users (uplink)"; unit=""; source="ActiveUsersUl"; record=vector);
}

module GNodeBStatsCollector extends BaseStationStatsCollector
Expand Down

0 comments on commit 21f2895

Please sign in to comment.