Overview / Math, game & observability

profiler

Per-section timing, with a report and CSV export.

Always compiled: part of the core build.Include #include <ethereal/cpp/profiler/profiler_inc.hpp>C layer

profiler_inc.hpp

#include <ethereal/cpp/profiler/profiler_inc.hpp>

profiler.hpp

#include <ethereal/cpp/profiler/profiler.hpp>
class

CProfilerManager

Ethereal::Profiler#

Profiler manager class.

class CProfilerManager final

It is not guaranteed to be thread-safe. Synchronization is the responsibility of its caller. It must not be inherited directly by any structure, class or object.

function

Instance

#
static CProfilerManager & Instance() noexcept;

Gets the singleton instance of the profiler manager.

Reference to the single instance of CProfilerManager.
function

AddData

#
void AddData( const char * SectionName, const ETL_DOUBLE Duration );

Adds the data to the profiler. Must not be called directly. Use the ETL_PROFILE_FUNC or ETL_PROFILE_AUTO macros.

SectionName
Name of the function or code section.
Duration
Duration of the execution time.
function

BeginManual

#
void BeginManual( const char * SectionName );

Starts a manual measurement of the section. Must not be called directly. Use the ETL_PROFILE_START macro.

SectionName
Name of the function or code section.
function

EndManual

#
void EndManual( const char * SectionName );

Ends the manual measurement of the section. Must not be called directly. Use the ETL_PROFILE_END macro.

SectionName
Name of the function or code section.
function

GetDataReport

#
std::string GetDataReport( void );

Gets the report of the current profiler data.

std::string formatted with the current data and statistics of the profiler.
function

ExportDataReportToCSV

#
bool ExportDataReportToCSV( const char * OutputPath );

Exports the recorded profiler data to a CSV file in the given directory.

OutputPath
Directory where the profiler file is created.
Result of the operation. true if the file was generated correctly. false if generating the file failed.
class

CScopedProfiler

Ethereal::Profiler#

Scope profile class.

class CScopedProfiler final

It is not guaranteed to be thread-safe. Synchronization is the responsibility of its caller. It must not be inherited directly by any structure, class or object.

constructor

CScopedProfiler

#
explicit CScopedProfiler( const char * sSectionName ) noexcept;

Default constructor.