MxEngine
Public Member Functions | List of all members
MxEngine::ProfileSession Class Reference

#include <Profiler.h>

Public Member Functions

bool IsValid () const
 
size_t GetEntryCount () const
 
void StartSession (const MxString &filename)
 
void WriteJsonEntry (const char *function, TimeStep begin, TimeStep delta)
 
void EndSession ()
 

Detailed Description

profile session is a special singleton object which periodically writes log to a json file it is used inside ScopeProfiler to write time measurements. After application exit log can be viewed at chrome://tracing page

Member Function Documentation

§ EndSession()

void MxEngine::ProfileSession::EndSession ( )

ends profile measurement, writing json footer and saving json file to disk

§ GetEntryCount()

size_t MxEngine::ProfileSession::GetEntryCount ( ) const

getter for entriesCount

Returns
number of json entries

§ IsValid()

bool MxEngine::ProfileSession::IsValid ( ) const

checks if json file is opened

Returns
true if json file can be written to, false either

§ StartSession()

void MxEngine::ProfileSession::StartSession ( const MxString &  filename)

creates json file or clears it if it exists and writes json header to it

Parameters
filenamefile to output json to

§ WriteJsonEntry()

void MxEngine::ProfileSession::WriteJsonEntry ( const char *  function,
TimeStep  begin,
TimeStep  delta 
)

writes json entry, consisting of process id, start/end time, function name

Parameters
functioncalled function name
beginstart timepoint of function execution
deltaduration of function execution

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