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. | |
Result | Run () |
Run the benchmark as configured. | |
void | SetPopulation (const uint64_t population) |
Set the number of events to populate the scheduler with. | |
void | SetRandomStream (Ptr< RandomVariableStream > stream) |
Set the event delay interval random stream. | |
void | SetTotal (const uint64_t total) |
Set the total number of events to execute. | |
Private Member Functions | |
void | Cb () |
Event function. | |
Private Attributes | |
uint64_t | m_count |
Count of events executed so far. | |
uint64_t | m_population |
Event population size. | |
Ptr< RandomVariableStream > | m_rand |
Stream for event delays. | |
uint64_t | m_total |
Total number of events to execute. | |
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 47 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 55 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 153 of file bench-scheduler.cc.
References Cb(), DEB, ns3::RandomVariableStream::GetValue(), m_count, m_rand, m_total, ns3::NanoSeconds(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Simulator::Stop().
Referenced by Cb(), and Run().
Bench::Result Bench::Run | ( | ) |
Run the benchmark as configured.
Definition at line 123 of file bench-scheduler.cc.
References Cb(), DEB, ns3::Simulator::Destroy(), ns3::SystemWallClockMs::End(), ns3::RandomVariableStream::GetValue(), m_count, m_population, m_rand, 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 78 of file bench-scheduler.cc.
References m_population.
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 68 of file bench-scheduler.cc.
References m_rand.
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 87 of file bench-scheduler.cc.
References m_total.
Referenced by BenchSuite::BenchSuite().
|
private |
Count of events executed so far.
Definition at line 118 of file bench-scheduler.cc.
|
private |
Event population size.
Definition at line 116 of file bench-scheduler.cc.
Referenced by Run(), and SetPopulation().
|
private |
Stream for event delays.
Definition at line 115 of file bench-scheduler.cc.
Referenced by Cb(), Run(), and SetRandomStream().
|
private |
Total number of events to execute.
Definition at line 117 of file bench-scheduler.cc.
Referenced by Cb(), and SetTotal().