Minetest  5.4.0
Profiler Class Reference

#include <profiler.h>

+ Collaboration diagram for Profiler:

Public Types

typedef std::map< std::string, float > GraphValues
 

Public Member Functions

 Profiler ()
 
void add (const std::string &name, float value)
 
void avg (const std::string &name, float value)
 
void clear ()
 
float getValue (const std::string &name) const
 
int getAvgCount (const std::string &name) const
 
u64 getElapsedMs () const
 
int print (std::ostream &o, u32 page=1, u32 pagecount=1)
 
void getPage (GraphValues &o, u32 page, u32 pagecount)
 
void graphAdd (const std::string &id, float value)
 
void graphGet (GraphValues &result)
 
void remove (const std::string &name)
 

Private Attributes

std::mutex m_mutex
 
std::map< std::string, float > m_data
 
std::map< std::string, int > m_avgcounts
 
std::map< std::string, float > m_graphvalues
 
u64 m_start_time
 

Member Typedef Documentation

◆ GraphValues

typedef std::map<std::string, float> Profiler::GraphValues

Constructor & Destructor Documentation

◆ Profiler()

Profiler::Profiler ( )

References porting::getTimeMs(), and m_start_time.

+ Here is the call graph for this function:

Member Function Documentation

◆ add()

void Profiler::add ( const std::string &  name,
float  value 
)

References m_avgcounts, m_data, and m_mutex.

Referenced by ScopeProfiler::~ScopeProfiler(), Server::AsyncRunStep(), ServerMap::save(), and Map::timerUpdate().

+ Here is the caller graph for this function:

◆ avg()

void Profiler::avg ( const std::string &  name,
float  value 
)

◆ clear()

void Profiler::clear ( )

References porting::getTimeMs(), m_avgcounts, m_data, m_mutex, and m_start_time.

Referenced by dedicated_server_loop(), and Game::updateProfilers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAvgCount()

int Profiler::getAvgCount ( const std::string &  name) const

References m_avgcounts.

Referenced by getPage(), and print().

+ Here is the caller graph for this function:

◆ getElapsedMs()

u64 Profiler::getElapsedMs ( ) const

References porting::getTimeMs(), and m_start_time.

Referenced by GameUI::updateProfiler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPage()

void Profiler::getPage ( GraphValues o,
u32  page,
u32  pagecount 
)

References getAvgCount(), m_data, m_mutex, and paging().

Referenced by print().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValue()

float Profiler::getValue ( const std::string &  name) const

References m_avgcounts, and m_data.

◆ graphAdd()

void Profiler::graphAdd ( const std::string &  id,
float  value 
)
inline

References m_graphvalues, and m_mutex.

Referenced by ScopeProfiler::~ScopeProfiler(), Client::ProcessData(), con::Peer::RTTStatistics(), con::ConnectionSendThread::runTimeouts(), Client::step(), Game::updateFrame(), and Game::updateProfilers().

+ Here is the caller graph for this function:

◆ graphGet()

void Profiler::graphGet ( GraphValues result)
inline

References m_graphvalues, and m_mutex.

Referenced by Game::run(), and Game::updateProfilerGraphs().

+ Here is the caller graph for this function:

◆ print()

int Profiler::print ( std::ostream &  o,
u32  page = 1,
u32  pagecount = 1 
)

References getAvgCount(), getPage(), and porting::mt_snprintf().

Referenced by Server::AsyncRunStep(), dedicated_server_loop(), ServerMap::save(), Map::timerUpdate(), GameUI::updateProfiler(), and Game::updateProfilers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove()

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

References m_avgcounts, m_data, and m_mutex.

Referenced by con::Peer::Drop(), con::ConnectionSendThread::run(), and con::ConnectionReceiveThread::run().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_avgcounts

std::map<std::string, int> Profiler::m_avgcounts
private

◆ m_data

std::map<std::string, float> Profiler::m_data
private

Referenced by add(), avg(), clear(), getPage(), getValue(), and remove().

◆ m_graphvalues

std::map<std::string, float> Profiler::m_graphvalues
private

Referenced by graphAdd(), and graphGet().

◆ m_mutex

std::mutex Profiler::m_mutex
private

◆ m_start_time

u64 Profiler::m_start_time
private

Referenced by Profiler(), clear(), and getElapsedMs().


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