JayBeams  0.1
Another project to have fun coding.
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
jb::testing::microbenchmark_base Class Reference

Refactor non-template parts of the microbenchmark template class. More...

#include <microbenchmark_base.hpp>

Inheritance diagram for jb::testing::microbenchmark_base:
jb::testing::microbenchmark< Fixture >

Classes

struct  summary
 A simple object to contain the summary of the test results. More...
 

Public Types

typedef std::chrono::steady_clock clock
 
typedef clock::duration duration
 
typedef std::pair< int, durationresult
 
typedef std::vector< resultresults
 

Public Member Functions

 microbenchmark_base (microbenchmark_config const &cfg)
 Constructor from a configuration. More...
 
void typical_output (results const &r) const
 Produce the results of the test in a format that works for most cases. More...
 
void write_results (std::ostream &os, results const &r) const
 Stream the detailed results. More...
 

Protected Attributes

microbenchmark_config config_
 

Detailed Description

Refactor non-template parts of the microbenchmark template class.

Definition at line 17 of file microbenchmark_base.hpp.

Member Typedef Documentation

◆ clock

typedef std::chrono::steady_clock jb::testing::microbenchmark_base::clock

Definition at line 19 of file microbenchmark_base.hpp.

◆ duration

Definition at line 20 of file microbenchmark_base.hpp.

◆ result

Definition at line 21 of file microbenchmark_base.hpp.

◆ results

Definition at line 22 of file microbenchmark_base.hpp.

Constructor & Destructor Documentation

◆ microbenchmark_base()

jb::testing::microbenchmark_base::microbenchmark_base ( microbenchmark_config const &  cfg)
inlineexplicit

Constructor from a configuration.

Definition at line 27 of file microbenchmark_base.hpp.

Member Function Documentation

◆ typical_output()

void jb::testing::microbenchmark_base::typical_output ( results const &  r) const

Produce the results of the test in a format that works for most cases.

In most of the JayBeams tests we print the summary results to stderr and the summary results to stdout. That makes it relatively easy to capture both separately in driver scripts.

Definition at line 5 of file microbenchmark_base.cpp.

References config_, jb::testing::microbenchmark_config::size, jb::testing::microbenchmark_config::test_case, jb::testing::microbenchmark_config::verbose, and write_results().

◆ write_results()

void jb::testing::microbenchmark_base::write_results ( std::ostream &  os,
results const &  r 
) const

Stream the detailed results.

Definition at line 20 of file microbenchmark_base.cpp.

References config_, and jb::testing::microbenchmark_config::prefix.

Referenced by typical_output().

Member Data Documentation

◆ config_

microbenchmark_config jb::testing::microbenchmark_base::config_
protected

Definition at line 72 of file microbenchmark_base.hpp.

Referenced by typical_output(), and write_results().


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