#include <profiler.h>
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 |
typedef std::map<std::string, float> Profiler::GraphValues |
Profiler::Profiler | ( | ) |
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().
void Profiler::avg | ( | const std::string & | name, |
float | value | ||
) |
References m_avgcounts, m_data, m_mutex, and MYMAX.
Referenced by ScopeProfiler::~ScopeProfiler(), MeshUpdateQueue::addBlock(), MeshUpdateQueue::cleanupCache(), ModApiBase::l_deprecated_function(), ClientMap::renderMap(), ClientEnvironment::step(), ServerEnvironment::step(), client::ActiveObjectMgr::step(), server::ActiveObjectMgr::step(), ClientMap::updateDrawList(), updateFastFaceRow(), and Game::updateFrame().
void Profiler::clear | ( | ) |
References porting::getTimeMs(), m_avgcounts, m_data, m_mutex, and m_start_time.
Referenced by dedicated_server_loop(), and Game::updateProfilers().
int Profiler::getAvgCount | ( | const std::string & | name | ) | const |
References m_avgcounts.
Referenced by getPage(), and print().
u64 Profiler::getElapsedMs | ( | ) | const |
References porting::getTimeMs(), and m_start_time.
Referenced by GameUI::updateProfiler().
void Profiler::getPage | ( | GraphValues & | o, |
u32 | page, | ||
u32 | pagecount | ||
) |
References getAvgCount(), m_data, m_mutex, and paging().
Referenced by print().
float Profiler::getValue | ( | const std::string & | name | ) | const |
References m_avgcounts, and m_data.
|
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().
|
inline |
References m_graphvalues, and m_mutex.
Referenced by Game::run(), and Game::updateProfilerGraphs().
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().
|
inline |
References m_avgcounts, m_data, and m_mutex.
Referenced by con::Peer::Drop(), con::ConnectionSendThread::run(), and con::ConnectionReceiveThread::run().
|
private |
Referenced by add(), avg(), clear(), getAvgCount(), getValue(), and remove().
|
private |
|
private |
Referenced by graphAdd(), and graphGet().
|
private |
Referenced by add(), avg(), clear(), getPage(), graphAdd(), graphGet(), and remove().
|
private |
Referenced by Profiler(), clear(), and getElapsedMs().