Benchmark instance which can do a single run. More...
Classes | |
struct | Result |
The output. More... | |
Public Member Functions | |
Bench (const uint64_t population, const uint64_t total) | |
Constructor. More... | |
Result | Run () |
Run the benchmark as configured. More... | |
void | SetPopulation (const uint64_t population) |
Set the number of events to populate the scheduler with. More... | |
void | SetRandomStream (Ptr< RandomVariableStream > stream) |
Set the event delay interval random stream. More... | |
void | SetTotal (const uint64_t total) |
Set the total number of events to execute. More... | |
Private Member Functions | |
void | Cb () |
Event function. More... | |
Private Attributes | |
uint64_t | m_count |
Count of events executed so far. More... | |
uint64_t | m_population |
Event population size. More... | |
Ptr< RandomVariableStream > | m_rand |
Stream for event delays. More... | |
uint64_t | m_total |
Total number of events to execute. More... | |
Benchmark instance which can do a single run.
The run is controlled by the event population size and total number of events, which are set at construction.
The event distribution in time is set by SetRandomStream()
Definition at line 58 of file bench-scheduler.cc.
|
inline |
Constructor.
[in] | population | The number of events to keep in the scheduler. |
[in] | total | The total number of events to execute. |
Definition at line 66 of file bench-scheduler.cc.
|
private |
Event function.
This checks for completion (total number of events executed) and schedules a new event if not complete.
Definition at line 164 of file bench-scheduler.cc.
References DEB, ns3::NanoSeconds(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Simulator::Stop().
Referenced by Run().
Bench::Result Bench::Run | ( | ) |
Run the benchmark as configured.
Definition at line 134 of file bench-scheduler.cc.
References Cb(), DEB, ns3::Simulator::Destroy(), ns3::SystemWallClockMs::End(), ns3::NanoSeconds(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), and ns3::SystemWallClockMs::Start().
Referenced by BenchSuite::BenchSuite().
|
inline |
Set the number of events to populate the scheduler with.
Each event executed schedules a new event, maintaining the population.
[in] | population | The number of events to keep in the scheduler. |
Definition at line 89 of file bench-scheduler.cc.
Referenced by BenchSuite::BenchSuite().
|
inline |
Set the event delay interval random stream.
[in] | stream | The random variable stream to be used to generate delays for future events. |
Definition at line 79 of file bench-scheduler.cc.
Referenced by BenchSuite::BenchSuite().
|
inline |
Set the total number of events to execute.
[in] | total | The total number of events to execute. |
Definition at line 98 of file bench-scheduler.cc.
Referenced by BenchSuite::BenchSuite().
|
private |
Count of events executed so far.
Definition at line 129 of file bench-scheduler.cc.
|
private |
Event population size.
Definition at line 127 of file bench-scheduler.cc.
|
private |
Stream for event delays.
Definition at line 126 of file bench-scheduler.cc.
|
private |
Total number of events to execute.
Definition at line 128 of file bench-scheduler.cc.