Yaets
Loading...
Searching...
No Matches
NamedSharedTrace Class Reference

Class to manage shared traces across different parts of the code. More...

#include <tracing.hpp>

Collaboration diagram for NamedSharedTrace:

Public Member Functions

void end ()
 End the current trace event.
 
 NamedSharedTrace (TraceSession &session, const std::string &trace_name)
 Construct a new NamedSharedTrace object.
 
void start ()
 Start a new trace event.
 

Static Public Attributes

static const size_t TRACE_SIZE_INIT = 100
 Initial size for the start_times_ vector.
 

Detailed Description

Class to manage shared traces across different parts of the code.

The NamedSharedTrace class allows tracing events that can occur in various parts of the code and logs both start and end times to a shared TraceSession. It supports concurrent operations and capacity handling.

Constructor & Destructor Documentation

◆ NamedSharedTrace()

NamedSharedTrace ( TraceSession & session,
const std::string & trace_name )

Construct a new NamedSharedTrace object.

Initializes a named trace session that can be started and ended across different locations.

Parameters
sessionThe TraceSession associated with the trace events.
trace_nameThe name of the trace event being recorded.

Member Function Documentation

◆ end()

void end ( )

End the current trace event.

Records the end time of a trace event and registers it with the TraceSession. Ensures that a corresponding start time exists.

◆ start()

void start ( )

Start a new trace event.

Records the start time of a trace event in a thread-safe manner.

Member Data Documentation

◆ TRACE_SIZE_INIT

const size_t TRACE_SIZE_INIT = 100
static

Initial size for the start_times_ vector.


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