Writing Fixture#

Base Class of Fixture#

class FixtureBase : public stat_bench::bench_impl::IBenchmarkCase#

Inheritance diagram for stat_bench::FixtureBase:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="stat_bench::FixtureBase" tooltip="stat_bench::FixtureBase" fillcolor="#BFBFBF"]
    "2" [label="stat_bench::bench_impl::IBenchmarkCase" tooltip="stat_bench::bench_impl::IBenchmarkCase"]
    "3" [label="stat_bench::bench_impl::NullFixture" tooltip="stat_bench::bench_impl::NullFixture"]
    "1" -> "2" [dir=forward tooltip="public-inheritance"]
    "3" -> "1" [dir=forward tooltip="public-inheritance"]
}

Collaboration diagram for stat_bench::FixtureBase:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="stat_bench::FixtureBase" tooltip="stat_bench::FixtureBase" fillcolor="#BFBFBF"]
    "2" [label="stat_bench::bench_impl::IBenchmarkCase" tooltip="stat_bench::bench_impl::IBenchmarkCase"]
    "1" -> "2" [dir=forward tooltip="public-inheritance"]
}

Base class of fixtures.

Subclassed by stat_bench::bench_impl::NullFixture

Virtual functions implemented in fixture classes.

inline virtual void setup(InvocationContext &context)#

Setup before running actual process.

Note

This can be implemented in fixtures to perform common initialization process.

Parameters:

context[in] Context.

inline virtual void tear_down(InvocationContext &context)#

Tear down after running actual process.

Note

This can be implemented in fixtures to perform common finalization process.

Note

This will be called even when errors occurred in run function.

Parameters:

context[in] Context.

Functions to set parameters.

template<typename T>
inline std::shared_ptr<param::ParameterValueVector<T>> add_param(const param::ParameterName &param_name)#

Add a parameter.

Template Parameters:

T – Type of parameter values.

Parameters:

param_name[in] Parameter name.

Returns:

Vector of parameter values.

template<typename T>
inline std::shared_ptr<param::ParameterValueVector<T>> add_param(std::string param_name)#

Add a parameter.

Template Parameters:

T – Type of parameter values.

Parameters:

param_name[in] Parameter name.

Returns:

Vector of parameter values.

inline std::shared_ptr<param::ParameterValueVector<std::size_t>> add_threads_param()#

Add a parameter of the number of threads.

Returns:

Vector of parameter values.

Public Functions

virtual void run() = 0#

Run actual process in each case.

Note

This will be implemented in each case, so don’t implement in fixtures.

class IBenchmarkCase#

Inheritance diagram for stat_bench::bench_impl::IBenchmarkCase:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="stat_bench::FixtureBase" tooltip="stat_bench::FixtureBase"]
    "1" [label="stat_bench::bench_impl::IBenchmarkCase" tooltip="stat_bench::bench_impl::IBenchmarkCase" fillcolor="#BFBFBF"]
    "3" [label="stat_bench::bench_impl::NullFixture" tooltip="stat_bench::bench_impl::NullFixture"]
    "2" -> "1" [dir=forward tooltip="public-inheritance"]
    "3" -> "2" [dir=forward tooltip="public-inheritance"]
}

Collaboration diagram for stat_bench::bench_impl::IBenchmarkCase:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="stat_bench::bench_impl::IBenchmarkCase" tooltip="stat_bench::bench_impl::IBenchmarkCase" fillcolor="#BFBFBF"]
}

Interface of cases in benchmarks.

Subclassed by stat_bench::FixtureBase

Classes Used with Fixtures#

enum class stat_bench::stat::CustomOutputAnalysisType : std::uint8_t#

Enumeration of types of analysis applied to custom outputs.

Values:

enumerator mean#

Mean per sample.

enumerator rate_per_sec#

Rate per sec.

class CustomStatOutput#

Class of custom outputs with statistics.

Public Functions

inline void add(std::size_t thread_index, std::size_t sample_index, double val)#

Add a value.

Parameters:
  • thread_index[in] Index of the thread.

  • sample_index[in] Index of the sample.

  • val[in] Value of the current iteration.

template<typename T>
class ParameterValueVector : public stat_bench::param::IParameterValueVector#

Inheritance diagram for stat_bench::param::ParameterValueVector:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="stat_bench::param::IParameterValueVector" tooltip="stat_bench::param::IParameterValueVector"]
    "1" [label="stat_bench::param::ParameterValueVector< T >" tooltip="stat_bench::param::ParameterValueVector< T >" fillcolor="#BFBFBF"]
    "1" -> "2" [dir=forward tooltip="public-inheritance"]
}

Collaboration diagram for stat_bench::param::ParameterValueVector:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="stat_bench::param::IParameterValueVector" tooltip="stat_bench::param::IParameterValueVector"]
    "1" [label="stat_bench::param::ParameterValueVector< T >" tooltip="stat_bench::param::ParameterValueVector< T >" fillcolor="#BFBFBF"]
    "1" -> "2" [dir=forward tooltip="public-inheritance"]
}

Class of vectors of parameter values.

Template Parameters:

T – Type of values.

Public Functions

inline ParameterValueVector *add(const T &value)#

Add a value.

Parameters:

value[in] Value.

Returns:

This.

class IParameterValueVector#

Inheritance diagram for stat_bench::param::IParameterValueVector:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="stat_bench::param::IParameterValueVector" tooltip="stat_bench::param::IParameterValueVector" fillcolor="#BFBFBF"]
    "2" [label="stat_bench::param::ParameterValueVector< T >" tooltip="stat_bench::param::ParameterValueVector< T >"]
    "2" -> "1" [dir=forward tooltip="public-inheritance"]
}

Collaboration diagram for stat_bench::param::IParameterValueVector:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="stat_bench::param::IParameterValueVector" tooltip="stat_bench::param::IParameterValueVector" fillcolor="#BFBFBF"]
}

Interface of vectors of parameter values.

Subclassed by stat_bench::param::ParameterValueVector< T >