Classes | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
hayai::Benchmarker Class Reference

Benchmarking execution controller singleton. More...

#include <hayai_benchmarker.hpp>

List of all members.

Classes

struct  CalibrationModel
 Calibration model. More...

Static Public Member Functions

static void AddOutputter (Outputter &outputter)
 Add an outputter.
static void ApplyPatternFilter (const char *pattern)
 Apply a pattern filter to the tests.
static BenchmarkerInstance ()
 Get the singleton instance of Benchmarker.
static std::vector< const
TestDescriptor * > 
ListTests ()
 List tests.
static TestDescriptorRegisterTest (const char *fixtureName, const char *testName, std::size_t runs, std::size_t iterations, TestFactory *testFactory, TestParametersDescriptor parameters)
 Register a test with the benchmarker instance.
static void RunAllTests ()
 Run all benchmarking tests.
static void ShuffleTests ()
 Shuffle tests.

Private Member Functions

 Benchmarker ()
 Private constructor.
std::vector< TestDescriptor * > GetTests () const
 Get the tests to be executed.
 ~Benchmarker ()
 Private destructor.

Static Private Member Functions

static bool FilterMatchesString (const char *filter, const std::string &str)
 Test if a filter matches a string.
static CalibrationModel GetCalibrationModel ()
 Get calibration model.
static bool PatternMatchesString (const char *pattern, const char *str)
 Test if pattern matches a string.

Private Attributes

std::vector< std::string > _include
 Test filters.
std::vector< Outputter * > _outputters
 Registered outputters.
std::vector< TestDescriptor * > _tests
 Registered tests.

Detailed Description

Benchmarking execution controller singleton.

Definition at line 19 of file hayai_benchmarker.hpp.


Constructor & Destructor Documentation

hayai::Benchmarker::Benchmarker ( ) [inline, private]

Private constructor.

Definition at line 368 of file hayai_benchmarker.hpp.

hayai::Benchmarker::~Benchmarker ( ) [inline, private]

Private destructor.

Definition at line 375 of file hayai_benchmarker.hpp.


Member Function Documentation

static void hayai::Benchmarker::AddOutputter ( Outputter outputter) [inline, static]

Add an outputter.

Parameters:
outputterOutputter. The caller must ensure that the outputter remains in existence for the entire benchmark run.

Definition at line 80 of file hayai_benchmarker.hpp.

static void hayai::Benchmarker::ApplyPatternFilter ( const char *  pattern) [inline, static]

Apply a pattern filter to the tests.

--gtest_filter-compatible pattern:

https://code.google.com/p/googletest/wiki/AdvancedGuide

Parameters:
patternFilter pattern compatible with gtest.

Definition at line 93 of file hayai_benchmarker.hpp.

static bool hayai::Benchmarker::FilterMatchesString ( const char *  filter,
const std::string &  str 
) [inline, static, private]

Test if a filter matches a string.

Adapted from gtest. All rights reserved by original authors.

Definition at line 406 of file hayai_benchmarker.hpp.

static CalibrationModel hayai::Benchmarker::GetCalibrationModel ( ) [inline, static, private]

Get calibration model.

Returns an average linear calibration model.

Definition at line 463 of file hayai_benchmarker.hpp.

std::vector<TestDescriptor*> hayai::Benchmarker::GetTests ( ) const [inline, private]

Get the tests to be executed.

Definition at line 388 of file hayai_benchmarker.hpp.

static Benchmarker& hayai::Benchmarker::Instance ( ) [inline, static]

Get the singleton instance of Benchmarker.

Returns:
a reference to the singleton instance of the benchmarker execution controller.

Definition at line 26 of file hayai_benchmarker.hpp.

static std::vector<const TestDescriptor*> hayai::Benchmarker::ListTests ( ) [inline, static]

List tests.

Definition at line 302 of file hayai_benchmarker.hpp.

static bool hayai::Benchmarker::PatternMatchesString ( const char *  pattern,
const char *  str 
) [inline, static, private]

Test if pattern matches a string.

Adapted from gtest. All rights reserved by original authors.

Definition at line 436 of file hayai_benchmarker.hpp.

static TestDescriptor* hayai::Benchmarker::RegisterTest ( const char *  fixtureName,
const char *  testName,
std::size_t  runs,
std::size_t  iterations,
TestFactory testFactory,
TestParametersDescriptor  parameters 
) [inline, static]

Register a test with the benchmarker instance.

Parameters:
fixtureNameName of the fixture.
testNameName of the test.
runsNumber of runs for the test.
iterationsNumber of iterations per run.
testFactoryTest factory implementation for the test.
Returns:
a pointer to a TestDescriptor instance representing the given test.

Definition at line 42 of file hayai_benchmarker.hpp.

static void hayai::Benchmarker::RunAllTests ( ) [inline, static]

Run all benchmarking tests.

Definition at line 145 of file hayai_benchmarker.hpp.

static void hayai::Benchmarker::ShuffleTests ( ) [inline, static]

Shuffle tests.

Randomly shuffles the order of tests.

Definition at line 321 of file hayai_benchmarker.hpp.


Member Data Documentation

std::vector<std::string> hayai::Benchmarker::_include [private]

Test filters.

Definition at line 579 of file hayai_benchmarker.hpp.

std::vector<Outputter*> hayai::Benchmarker::_outputters [private]

Registered outputters.

Definition at line 577 of file hayai_benchmarker.hpp.

std::vector<TestDescriptor*> hayai::Benchmarker::_tests [private]

Registered tests.

Definition at line 578 of file hayai_benchmarker.hpp.


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


hayai
Author(s): Nick Bruun
autogenerated on Thu Jun 6 2019 18:13:43