Writing Fixture#
Base Class of Fixture#
-
class FixtureBase : public stat_bench::bench_impl::IBenchmarkCase#
Inheritance diagram for stat_bench::FixtureBase:
Collaboration diagram for stat_bench::FixtureBase:
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.
Add a parameter.
- Template Parameters:
T – Type of parameter values.
- Parameters:
param_name – [in] Parameter name.
- Returns:
Vector of parameter values.
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.
-
inline virtual void setup(InvocationContext &context)#
-
class IBenchmarkCase#
Inheritance diagram for stat_bench::bench_impl::IBenchmarkCase:
Collaboration diagram for stat_bench::bench_impl::IBenchmarkCase:
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.
-
enumerator mean#
-
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.
-
inline void add(std::size_t thread_index, std::size_t sample_index, double val)#
-
template<typename T>
class ParameterValueVector : public stat_bench::param::IParameterValueVector# Inheritance diagram for stat_bench::param::ParameterValueVector:
Collaboration diagram for stat_bench::param::ParameterValueVector:
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:
Collaboration diagram for stat_bench::param::IParameterValueVector:
Interface of vectors of parameter values.
Subclassed by stat_bench::param::ParameterValueVector< T >