Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseStationStatsCollector: Emit some statistics #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/corenetwork/statsCollector/BaseStationStatsCollector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,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 @@ -290,27 +296,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