![]() |
mutable
A Database System for Research and Fast Prototyping
|
Collect timings of events. More...
#include <Timer.hpp>
Data Structures | |
| struct | Measurement |
| struct | TimingProcess |
A proxy class to record a Measurement with a Timer. More... | |
Public Types | |
| using | clock = std::chrono::high_resolution_clock |
| using | duration = clock::duration |
| using | time_point = clock::time_point |
Public Member Functions | |
| auto | begin () const |
| auto | end () const |
| auto | cbegin () const |
| auto | cend () const |
| const std::vector< Measurement > & | measurements () const |
| const Measurement & | get (std::size_t i) const |
| const Measurement & | get (const std::string &name) const |
| void | clear () |
Erase all Measurements from this Timer. | |
| TimingProcess | create_timing (std::string name) |
Creates a new TimingProcess with the given name. | |
| void | dump (std::ostream &out) const |
| void | dump () const |
| M_LCOV_EXCL_STOP duration | total () const |
Computes the total duration of all Measurements. | |
Private Member Functions | |
| std::size_t | start (std::string name) |
Start a new Measurement with the name name. | |
| void | stop (std::size_t id) |
Stops the Measurement with the given ID. | |
Private Attributes | |
| std::vector< Measurement > | measurements_ |
Friends | |
| M_LCOV_EXCL_START friend std::ostream & | operator<< (std::ostream &out, const Timer &timer) |
Print all finished and in-process timings of timer to out. | |
| using m::Timer::clock = std::chrono::high_resolution_clock |
| using m::Timer::duration = clock::duration |
| using m::Timer::time_point = clock::time_point |
|
inline |
Definition at line 99 of file Timer.hpp.
References measurements_.
|
inline |
Definition at line 101 of file Timer.hpp.
References measurements_.
|
inline |
Definition at line 102 of file Timer.hpp.
References measurements_.
|
inline |
Erase all Measurements from this Timer.
Definition at line 119 of file Timer.hpp.
References measurements_.
|
inline |
Creates a new TimingProcess with the given name.
Definition at line 152 of file Timer.hpp.
References start().
Referenced by m::QueryDatabase::execute().
| void Timer::dump | ( | ) | const |
Definition at line 27 of file Timer.cpp.
References dump().
Referenced by m::Timer::Measurement::dump(), and dump().
|
inline |
Definition at line 100 of file Timer.hpp.
References measurements_.
|
inline |
Definition at line 110 of file Timer.hpp.
References measurements_.
|
inline |
Definition at line 105 of file Timer.hpp.
References measurements_.
Referenced by m::Timer::TimingProcess::~TimingProcess().
|
inline |
Definition at line 104 of file Timer.hpp.
References measurements_.
|
inlineprivate |
Start a new Measurement with the name name.
Returns the ID assigned to that Measurement.
Definition at line 123 of file Timer.hpp.
References id, and measurements_.
Referenced by create_timing().
|
inlineprivate |
Stops the Measurement with the given ID.
Definition at line 143 of file Timer.hpp.
References id, M_insist, and measurements_.
Referenced by m::Timer::TimingProcess::stop(), and m::Timer::TimingProcess::~TimingProcess().
|
inline |
Computes the total duration of all Measurements.
Definition at line 169 of file Timer.hpp.
References measurements_.
|
friend |
|
private |