Records wall-clock timings for (possibly nested) named Profiler::Spans and reports them in various formats.
More...
#include <fe/profile.h>
|
| using | Clock = std::chrono::steady_clock |
| using | Duration = Clock::duration |
|
| bool | empty () const |
| const auto & | spans () const |
Bracket a run with Profiler::start / Profiler::stop; the calls must nest like a stack.
|
| void | start (std::string_view name) |
| void | stop () |
| | Marks the end of the most recently started run; no-op if no Span is running.
|
| void | count (std::string_view key, uint64_t n=1) |
| | Adds n to counter key of the currently running Span; no-op if no Span is running or n is 0.
|
| void | summary (std::ostream &) const |
| void | tree (std::ostream &) const |
| | Prints the Spans as an indented tree, preserving the order in which they ran.
|
| void | chrome_trace (std::ostream &) const |
| | Dumps all Spans as Chrome Trace Event Format JSON.
|
|
| static constexpr size_t | No_Parent = std::numeric_limits<size_t>::max() |
Records wall-clock timings for (possibly nested) named Profiler::Spans and reports them in various formats.
Spans nest like a stack, so each one remembers its parent. From these Spans the Profiler can derive
Definition at line 23 of file profile.h.
◆ Clock
◆ Duration
◆ chrome_trace()
| void fe::Profiler::chrome_trace |
( |
std::ostream & | | ) |
const |
Dumps all Spans as Chrome Trace Event Format JSON.
◆ count()
| void fe::Profiler::count |
( |
std::string_view | key, |
|
|
uint64_t | n = 1 ) |
|
inline |
Adds n to counter key of the currently running Span; no-op if no Span is running or n is 0.
Definition at line 67 of file profile.h.
◆ empty()
| bool fe::Profiler::empty |
( |
| ) |
const |
|
inline |
◆ spans()
| const auto & fe::Profiler::spans |
( |
| ) |
const |
|
inline |
◆ start()
| void fe::Profiler::start |
( |
std::string_view | name | ) |
|
|
inline |
◆ stop()
| void fe::Profiler::stop |
( |
| ) |
|
|
inline |
Marks the end of the most recently started run; no-op if no Span is running.
Definition at line 59 of file profile.h.
◆ summary()
| void fe::Profiler::summary |
( |
std::ostream & | | ) |
const |
Prints a flat table aggregated by name, sorted by total time, descending.
◆ tree()
| void fe::Profiler::tree |
( |
std::ostream & | | ) |
const |
Prints the Spans as an indented tree, preserving the order in which they ran.
◆ No_Parent
| size_t fe::Profiler::No_Parent = std::numeric_limits<size_t>::max() |
|
staticconstexpr |
The documentation for this class was generated from the following file: