|
Yaets
|
Class to manage a trace session. More...
#include <tracing.hpp>
Public Member Functions | |
| void | register_trace (const std::string &trace_name, const std::chrono::nanoseconds &start_time, const std::chrono::nanoseconds &end_time) |
| Register a new trace event. | |
| void | stop () |
| Stop the trace session and flush remaining trace events to the file. | |
| TraceSession (const std::string &filename) | |
| Construct a new TraceSession object. | |
| ~TraceSession () | |
| Destroy the TraceSession object and stop tracing. | |
Class to manage a trace session.
A TraceSession manages the collection of trace events and stores them in a queue. It also handles the writing of the trace events to a file asynchronously via a separate consumer thread.
|
explicit |
Construct a new TraceSession object.
| filename | The name of the file to write the trace events to. |
| ~TraceSession | ( | ) |
Destroy the TraceSession object and stop tracing.
| void register_trace | ( | const std::string & | trace_name, |
| const std::chrono::nanoseconds & | start_time, | ||
| const std::chrono::nanoseconds & | end_time ) |
Register a new trace event.
This function is called by TraceGuard to register the start and end time of a function execution.
| trace_name | The name of the function being traced. |
| start_time | The start time of the function execution. |
| end_time | The end time of the function execution. |
| void stop | ( | ) |
Stop the trace session and flush remaining trace events to the file.