CppBenchmark  1.0.4.0
C++ Benchmark Library
Public Member Functions | Friends | List of all members
CppBenchmark::PhaseMetrics Class Reference

Benchmark phase metrics. More...

#include <phase_metrics.h>

Public Member Functions

 PhaseMetrics ()
 Default constructor. More...
 
 PhaseMetrics (const PhaseMetrics &)=default
 
 PhaseMetrics (PhaseMetrics &&) noexcept=default
 
 ~PhaseMetrics ()
 
PhaseMetricsoperator= (const PhaseMetrics &)=default
 
PhaseMetricsoperator= (PhaseMetrics &&) noexcept=default
 
bool latency () const noexcept
 Is metrics contains latency values? More...
 
int64_t min_latency () const noexcept
 Get latency minimal value of the phase execution. More...
 
int64_t max_latency () const noexcept
 Get latency maximal value of the phase execution. More...
 
double mean_latency () const noexcept
 Get latency mean value of the phase execution. More...
 
double stdv_latency () const noexcept
 Get latency standard deviation of the phase execution. More...
 
int64_t avg_time () const noexcept
 Get average time of the phase execution. More...
 
int64_t min_time () const noexcept
 Get minimal time of the phase execution. More...
 
int64_t max_time () const noexcept
 Get maximal time of the phase execution. More...
 
int64_t total_time () const noexcept
 Get total time of the phase execution. More...
 
int64_t total_operations () const noexcept
 Get total operations made in the phase. More...
 
int64_t total_items () const noexcept
 Get total items processed in the phase. More...
 
int64_t total_bytes () const noexcept
 Get total bytes processed in the phase. More...
 
int64_t operations_per_second () const noexcept
 Get operations throughput (operations / second) More...
 
int64_t items_per_second () const noexcept
 Get items throughput (items / second) More...
 
int64_t bytes_per_second () const noexcept
 Get data throughput (bytes / second) More...
 
const std::map< std::string, int > & custom_int () const noexcept
 Get custom integers map. More...
 
const std::map< std::string, unsigned > & custom_uint () const noexcept
 Get custom unsigned integers map. More...
 
const std::map< std::string, int64_t > & custom_int64 () const noexcept
 Get custom integers 64-bit map. More...
 
const std::map< std::string, uint64_t > & custom_uint64 () const noexcept
 Get custom unsigned integers 64-bit map. More...
 
const std::map< std::string, float > & custom_flt () const noexcept
 Get custom float map. More...
 
const std::map< std::string, double > & custom_dbl () const noexcept
 Get custom doubles map. More...
 
const std::map< std::string, std::string > & custom_str () const noexcept
 Get custom strings map. More...
 
int threads () const noexcept
 
void AddOperations (int64_t operations) noexcept
 Increase operations count of the current phase. More...
 
void AddItems (int64_t items) noexcept
 Register processed items in the current phase. More...
 
void AddBytes (int64_t bytes) noexcept
 Register processed bytes in the current phase. More...
 
void SetCustom (const std::string &name, int value)
 Set custom integer value. More...
 
void SetCustom (const std::string &name, unsigned value)
 Set custom unsigned integer value. More...
 
void SetCustom (const std::string &name, int64_t value)
 Set custom integer 64-bit value. More...
 
void SetCustom (const std::string &name, uint64_t value)
 Set custom unsigned integer 64-bit value. More...
 
void SetCustom (const std::string &name, float value)
 Set custom float value. More...
 
void SetCustom (const std::string &name, double value)
 Set custom double value. More...
 
void SetCustom (const std::string &name, const std::string &value)
 Set custom string value. More...
 
void SetThreads (int threads)
 Set threads value. More...
 
void AddLatency (int64_t latency) noexcept
 Add latency value of the current phase. More...
 

Friends

class PhaseCore
 

Detailed Description

Benchmark phase metrics.

Provides interface of the phase metrics to collect benchmark running statistics:

If the phase metrics is accessed from benchmark running Context you can update some metrics values:

Definition at line 36 of file phase_metrics.h.

Constructor & Destructor Documentation

◆ PhaseMetrics() [1/3]

CppBenchmark::PhaseMetrics::PhaseMetrics ( )

Default constructor.

Definition at line 24 of file phase_metrics.cpp.

◆ PhaseMetrics() [2/3]

CppBenchmark::PhaseMetrics::PhaseMetrics ( const PhaseMetrics )
default

◆ PhaseMetrics() [3/3]

CppBenchmark::PhaseMetrics::PhaseMetrics ( PhaseMetrics &&  )
defaultnoexcept

◆ ~PhaseMetrics()

CppBenchmark::PhaseMetrics::~PhaseMetrics ( )

Definition at line 29 of file phase_metrics.cpp.

Member Function Documentation

◆ AddBytes()

void CppBenchmark::PhaseMetrics::AddBytes ( int64_t  bytes)
inlinenoexcept

Register processed bytes in the current phase.

Parameters
bytes- Bytes count

Definition at line 117 of file phase_metrics.h.

◆ AddItems()

void CppBenchmark::PhaseMetrics::AddItems ( int64_t  items)
inlinenoexcept

Register processed items in the current phase.

Parameters
items- Items count
Examples
sort.cpp.

Definition at line 111 of file phase_metrics.h.

◆ AddLatency()

void CppBenchmark::PhaseMetrics::AddLatency ( int64_t  latency)
noexcept

Add latency value of the current phase.

Parameters
latency- Latency value

Definition at line 127 of file phase_metrics.cpp.

◆ AddOperations()

void CppBenchmark::PhaseMetrics::AddOperations ( int64_t  operations)
inlinenoexcept

Increase operations count of the current phase.

Parameters
operations- Operations count

Definition at line 105 of file phase_metrics.h.

◆ avg_time()

int64_t CppBenchmark::PhaseMetrics::avg_time ( ) const
noexcept

Get average time of the phase execution.

Definition at line 59 of file phase_metrics.cpp.

◆ bytes_per_second()

int64_t CppBenchmark::PhaseMetrics::bytes_per_second ( ) const
noexcept

Get data throughput (bytes / second)

Definition at line 90 of file phase_metrics.cpp.

◆ custom_dbl()

const std::map<std::string, double>& CppBenchmark::PhaseMetrics::custom_dbl ( ) const
inlinenoexcept

Get custom doubles map.

Definition at line 95 of file phase_metrics.h.

◆ custom_flt()

const std::map<std::string, float>& CppBenchmark::PhaseMetrics::custom_flt ( ) const
inlinenoexcept

Get custom float map.

Definition at line 93 of file phase_metrics.h.

◆ custom_int()

const std::map<std::string, int>& CppBenchmark::PhaseMetrics::custom_int ( ) const
inlinenoexcept

Get custom integers map.

Definition at line 85 of file phase_metrics.h.

◆ custom_int64()

const std::map<std::string, int64_t>& CppBenchmark::PhaseMetrics::custom_int64 ( ) const
inlinenoexcept

Get custom integers 64-bit map.

Definition at line 89 of file phase_metrics.h.

◆ custom_str()

const std::map<std::string, std::string>& CppBenchmark::PhaseMetrics::custom_str ( ) const
inlinenoexcept

Get custom strings map.

Definition at line 97 of file phase_metrics.h.

◆ custom_uint()

const std::map<std::string, unsigned>& CppBenchmark::PhaseMetrics::custom_uint ( ) const
inlinenoexcept

Get custom unsigned integers map.

Definition at line 87 of file phase_metrics.h.

◆ custom_uint64()

const std::map<std::string, uint64_t>& CppBenchmark::PhaseMetrics::custom_uint64 ( ) const
inlinenoexcept

Get custom unsigned integers 64-bit map.

Definition at line 91 of file phase_metrics.h.

◆ items_per_second()

int64_t CppBenchmark::PhaseMetrics::items_per_second ( ) const
noexcept

Get items throughput (items / second)

Definition at line 82 of file phase_metrics.cpp.

◆ latency()

bool CppBenchmark::PhaseMetrics::latency ( ) const
noexcept

Is metrics contains latency values?

Definition at line 34 of file phase_metrics.cpp.

◆ max_latency()

int64_t CppBenchmark::PhaseMetrics::max_latency ( ) const
noexcept

Get latency maximal value of the phase execution.

Definition at line 44 of file phase_metrics.cpp.

◆ max_time()

int64_t CppBenchmark::PhaseMetrics::max_time ( ) const
noexcept

Get maximal time of the phase execution.

Definition at line 69 of file phase_metrics.cpp.

◆ mean_latency()

double CppBenchmark::PhaseMetrics::mean_latency ( ) const
noexcept

Get latency mean value of the phase execution.

Definition at line 49 of file phase_metrics.cpp.

◆ min_latency()

int64_t CppBenchmark::PhaseMetrics::min_latency ( ) const
noexcept

Get latency minimal value of the phase execution.

Definition at line 39 of file phase_metrics.cpp.

◆ min_time()

int64_t CppBenchmark::PhaseMetrics::min_time ( ) const
noexcept

Get minimal time of the phase execution.

Definition at line 64 of file phase_metrics.cpp.

◆ operations_per_second()

int64_t CppBenchmark::PhaseMetrics::operations_per_second ( ) const
noexcept

Get operations throughput (operations / second)

Definition at line 74 of file phase_metrics.cpp.

◆ operator=() [1/2]

PhaseMetrics& CppBenchmark::PhaseMetrics::operator= ( const PhaseMetrics )
default

◆ operator=() [2/2]

PhaseMetrics& CppBenchmark::PhaseMetrics::operator= ( PhaseMetrics &&  )
defaultnoexcept

◆ SetCustom() [1/7]

void CppBenchmark::PhaseMetrics::SetCustom ( const std::string &  name,
const std::string &  value 
)
inline

Set custom string value.

Parameters
name- Name
value- Value

Definition at line 167 of file phase_metrics.h.

◆ SetCustom() [2/7]

void CppBenchmark::PhaseMetrics::SetCustom ( const std::string &  name,
double  value 
)
inline

Set custom double value.

Parameters
name- Name
value- Value

Definition at line 160 of file phase_metrics.h.

◆ SetCustom() [3/7]

void CppBenchmark::PhaseMetrics::SetCustom ( const std::string &  name,
float  value 
)
inline

Set custom float value.

Parameters
name- Name
value- Value

Definition at line 153 of file phase_metrics.h.

◆ SetCustom() [4/7]

void CppBenchmark::PhaseMetrics::SetCustom ( const std::string &  name,
int  value 
)
inline

Set custom integer value.

Parameters
name- Name
value- Value

Definition at line 125 of file phase_metrics.h.

◆ SetCustom() [5/7]

void CppBenchmark::PhaseMetrics::SetCustom ( const std::string &  name,
int64_t  value 
)
inline

Set custom integer 64-bit value.

Parameters
name- Name
value- Value

Definition at line 139 of file phase_metrics.h.

◆ SetCustom() [6/7]

void CppBenchmark::PhaseMetrics::SetCustom ( const std::string &  name,
uint64_t  value 
)
inline

Set custom unsigned integer 64-bit value.

Parameters
name- Name
value- Value

Definition at line 146 of file phase_metrics.h.

◆ SetCustom() [7/7]

void CppBenchmark::PhaseMetrics::SetCustom ( const std::string &  name,
unsigned  value 
)
inline

Set custom unsigned integer value.

Parameters
name- Name
value- Value

Definition at line 132 of file phase_metrics.h.

◆ SetThreads()

void CppBenchmark::PhaseMetrics::SetThreads ( int  threads)
inline

Set threads value.

Parameters
threads- Threads

Definition at line 174 of file phase_metrics.h.

◆ stdv_latency()

double CppBenchmark::PhaseMetrics::stdv_latency ( ) const
noexcept

Get latency standard deviation of the phase execution.

Definition at line 54 of file phase_metrics.cpp.

◆ threads()

int CppBenchmark::PhaseMetrics::threads ( ) const
inlinenoexcept

Definition at line 99 of file phase_metrics.h.

◆ total_bytes()

int64_t CppBenchmark::PhaseMetrics::total_bytes ( ) const
inlinenoexcept

Get total bytes processed in the phase.

Definition at line 75 of file phase_metrics.h.

◆ total_items()

int64_t CppBenchmark::PhaseMetrics::total_items ( ) const
inlinenoexcept

Get total items processed in the phase.

Definition at line 73 of file phase_metrics.h.

◆ total_operations()

int64_t CppBenchmark::PhaseMetrics::total_operations ( ) const
inlinenoexcept

Get total operations made in the phase.

Definition at line 71 of file phase_metrics.h.

◆ total_time()

int64_t CppBenchmark::PhaseMetrics::total_time ( ) const
inlinenoexcept

Get total time of the phase execution.

Definition at line 69 of file phase_metrics.h.

Friends And Related Function Documentation

◆ PhaseCore

friend class PhaseCore
friend

Definition at line 38 of file phase_metrics.h.


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