Celero
Classes | Public Member Functions | List of all members
celero::ThreadTestFixture Class Reference

#include <ThreadTestFixture.h>

Inheritance diagram for celero::ThreadTestFixture:
Inheritance graph
[legend]
Collaboration diagram for celero::ThreadTestFixture:
Collaboration graph
[legend]

Classes

class  Impl
 

Public Member Functions

 ThreadTestFixture ()
 Default Constructor.
 
virtual ~ThreadTestFixture ()
 Virtual destructor for inheritance.
 
 ThreadTestFixture (const ThreadTestFixture &)=delete
 
ThreadTestFixtureoperator= (ThreadTestFixture const &other)=delete
 
virtual void startThreads (uint64_t threads, uint64_t calls)
 Start threads before benchmark execution. More...
 
virtual void stopThreads ()
 Called after test completion to stop threads.
 
uint64_t run (uint64_t threads, uint64_t calls, const celero::TestFixture::ExperimentValue *const experimentValue) override
 
- Public Member Functions inherited from celero::TestFixture
 TestFixture ()
 Default Constructor.
 
virtual ~TestFixture ()
 Virtual destructor for inheritance.
 
virtual std::vector< std::shared_ptr< celero::TestFixture::ExperimentValue > > getExperimentValues () const
 Allows a test fixture to supply values to use for experiments. More...
 
virtual double getExperimentValueResultScale () const
 Provide a units result scale of each experiment value. More...
 
virtual void onExperimentStart (const celero::TestFixture::ExperimentValue *const x)
 Allows the text fixture to run code that will be executed once immediately before the benchmark. More...
 
virtual void onExperimentEnd ()
 Allows the text fixture to run code that will be executed once immediately after the benchmark. More...
 
virtual void setUp (const celero::TestFixture::ExperimentValue *const x)
 Set up the test fixture before benchmark execution. More...
 
void setExperimentTime (uint64_t x)
 Internal to Celero.
 
uint64_t getExperimentTime () const
 Valid inside tearDown().
 
void setExperimentIterations (uint64_t x)
 Internal to Celero.
 
uint64_t getExperimentIterations () const
 Valid inside tearDown().
 
virtual void tearDown ()
 Called after test completion to destroy the fixture. More...
 
virtual std::vector< std::shared_ptr< UserDefinedMeasurement > > getUserDefinedMeasurements () const
 If you want to use user-defined measurements, override this method to return them. More...
 
std::vector< std::string > getUserDefinedMeasurementNames () const
 Returns the names of all user-defined measurements in this fixture.
 

Additional Inherited Members

- Public Types inherited from celero::TestFixture
enum  Constants : int64_t { NoProblemSpaceValue = std::numeric_limits<int64_t>::min() }
 
- Protected Member Functions inherited from celero::TestFixture
virtual void UserBenchmark ()
 Executed for each operation the benchmarking test is run.
 
virtual uint64_t HardCodedMeasurement () const
 Only used for baseline cases. More...
 

Detailed Description

Author
Ivan Shynkarenka

Member Function Documentation

◆ run()

uint64_t ThreadTestFixture::run ( uint64_t  threads,
uint64_t  calls,
const celero::TestFixture::ExperimentValue *const  experimentValue 
)
overridevirtual
Parameters
threadsThe number of working threads.
callsThe total number of times to loop over the UserBenchmark function.
experimentValueThe experiment value to pass in setUp function.
Returns
Returns the number of microseconds the run took.

Reimplemented from celero::TestFixture.

◆ startThreads()

void ThreadTestFixture::startThreads ( uint64_t  threads,
uint64_t  calls 
)
virtual

Start threads before benchmark execution.

Parameters
threadsCount of working threads to start.
callsThe total number of times to loop over the UserBenchmark function.

The documentation for this class was generated from the following files: