Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::Alina::Profiler Class Reference

Profiler class. More...

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/alina/arccore/alina/Profiler.h>

Collaboration diagram for Arcane::Alina::Profiler:

Classes

struct  scoped_ticker
struct  profile_unit

Public Types

typedef double value_type
typedef double delta_type

Public Member Functions

 Profiler ()
 Initialization.
 Profiler (const std::string &name)
void tic (const std::string &name)
 Starts measurement.
delta_type toc (const std::string &="")
 Stops measurement.
void reset ()
scoped_ticker scoped_tic (const std::string &name)

Static Public Member Functions

static ProfilerglobalProfiler ()
static void globalTic (const std::string &name)
static delta_type globalToc (const std::string &="")
 Stops measurement.
static scoped_ticker global_scoped_tic (const std::string &name)

Private Member Functions

void init ()
void print (std::ostream &out) const

Private Attributes

std::string name
profile_unit root
std::vector< profile_unit * > stack

Static Private Attributes

static constexpr unsigned int SHIFT_WIDTH = 2

Friends

std::ostream & operator<< (std::ostream &out, const Profiler &prof)
 Sends formatted profiling data to an output stream.

Detailed Description

Profiler class.

Provides simple to use, hierarchical profile with nicely formatted output.

Definition at line 49 of file Profiler.h.

Member Typedef Documentation

◆ delta_type

typedef double Arcane::Alina::Profiler::delta_type

Definition at line 56 of file Profiler.h.

◆ value_type

typedef double Arcane::Alina::Profiler::value_type

Definition at line 55 of file Profiler.h.

Constructor & Destructor Documentation

◆ Profiler() [1/2]

Arcane::Alina::Profiler::Profiler ( )
inline

Initialization.

Definition at line 59 of file Profiler.h.

Referenced by operator<<.

Here is the caller graph for this function:

◆ Profiler() [2/2]

Arcane::Alina::Profiler::Profiler ( const std::string & name)
inline

Definition at line 65 of file Profiler.h.

Member Function Documentation

◆ global_scoped_tic()

scoped_ticker Arcane::Alina::Profiler::global_scoped_tic ( const std::string & name)
inlinestatic

Definition at line 116 of file Profiler.h.

◆ globalProfiler()

Profiler & Arcane::Alina::Profiler::globalProfiler ( )
static

Definition at line 25 of file Profiler.cc.

◆ globalTic()

void Arcane::Alina::Profiler::globalTic ( const std::string & name)
static

Definition at line 31 of file Profiler.cc.

◆ globalToc()

Profiler::delta_type Arcane::Alina::Profiler::globalToc ( const std::string & = "")
static

Stops measurement.

Returns delta in the measured value since the corresponding tic().

Definition at line 37 of file Profiler.cc.

◆ init()

void Arcane::Alina::Profiler::init ( )
private

Definition at line 88 of file Profiler.cc.

◆ print()

void Arcane::Alina::Profiler::print ( std::ostream & out) const
private

Definition at line 99 of file Profiler.cc.

◆ reset()

void Arcane::Alina::Profiler::reset ( )

Definition at line 74 of file Profiler.cc.

◆ scoped_tic()

scoped_ticker Arcane::Alina::Profiler::scoped_tic ( const std::string & name)
inline

Definition at line 111 of file Profiler.h.

◆ tic()

void Arcane::Alina::Profiler::tic ( const std::string & name)

Starts measurement.

Parameters
nameinterval name.

Definition at line 46 of file Profiler.cc.

References Arcane::Platform::getRealTime().

Here is the call graph for this function:

◆ toc()

Profiler::delta_type Arcane::Alina::Profiler::toc ( const std::string & = "")

Stops measurement.

Returns delta in the measured value since the corresponding tic().

Definition at line 56 of file Profiler.cc.

References Arcane::Platform::getRealTime().

Here is the call graph for this function:

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const Profiler & prof )
friend

Sends formatted profiling data to an output stream.

Parameters
outOutput stream.
profProfiler.

Definition at line 200 of file Profiler.h.

References Profiler().

Member Data Documentation

◆ name

std::string Arcane::Alina::Profiler::name
private

Definition at line 186 of file Profiler.h.

◆ root

profile_unit Arcane::Alina::Profiler::root
private

Definition at line 187 of file Profiler.h.

◆ SHIFT_WIDTH

unsigned int Arcane::Alina::Profiler::SHIFT_WIDTH = 2
staticconstexprprivate

Definition at line 51 of file Profiler.h.

◆ stack

std::vector<profile_unit*> Arcane::Alina::Profiler::stack
private

Definition at line 188 of file Profiler.h.


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