Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
Profiler Class Reference

Class that creates a JSON file with the time of execution of each function, files can be open at chrome://tracing/. More...

#include <Profiler.hpp>

Collaboration diagram for Profiler:

Public Member Functions

 Profiler ()
 Creates the Profiler object. More...
 
void BeginSession (const std::string &name)
 Starts the Profiler output file. More...
 
void EndSession ()
 Ends the Profiler output file. More...
 
void WriteProfile (const ProfileResult &result)
 Starts the Profiler output file. More...
 
void WriteHeader ()
 Writes the header file for the JSON-file. More...
 
void WriteFooter ()
 Writes the footer file for the JSON-file. More...
 

Static Public Member Functions

static ProfilerGet ()
 Gets the Profiler instance. More...
 

Private Attributes

InstrumentationSessionm_CurrentSession
 The name of the function to be Profile. More...
 
std::ofstream m_OutputStream
 The output JSON file where data is written. More...
 
int m_ProfileCount
 Counter for array separator. More...
 

Detailed Description

Class that creates a JSON file with the time of execution of each function, files can be open at chrome://tracing/.

See also
main.cpp

Constructor & Destructor Documentation

◆ Profiler()

Profiler::Profiler ( )
inline

Creates the Profiler object.

Member Function Documentation

◆ BeginSession()

void Profiler::BeginSession ( const std::string &  name)
inline

Starts the Profiler output file.

Parameters
nameName o the function to be timed.

◆ EndSession()

void Profiler::EndSession ( )
inline

Ends the Profiler output file.

◆ Get()

static Profiler& Profiler::Get ( )
inlinestatic

Gets the Profiler instance.

◆ WriteFooter()

void Profiler::WriteFooter ( )
inline

Writes the footer file for the JSON-file.

◆ WriteHeader()

void Profiler::WriteHeader ( )
inline

Writes the header file for the JSON-file.

◆ WriteProfile()

void Profiler::WriteProfile ( const ProfileResult result)
inline

Starts the Profiler output file.

Parameters
resultStructure that contains the profiler results.

Member Data Documentation

◆ m_CurrentSession

InstrumentationSession* Profiler::m_CurrentSession
private

The name of the function to be Profile.

◆ m_OutputStream

std::ofstream Profiler::m_OutputStream
private

The output JSON file where data is written.

◆ m_ProfileCount

int Profiler::m_ProfileCount
private

Counter for array separator.