Panda3D
|
Manages the communications to report statistics via a network connection to a remote PStatServer. More...
#include "pStatClient.h"
Public Member Functions | |
bool | client_connect (std::string hostname, int port) |
void | client_disconnect () |
bool | client_is_connected () const |
void | client_main_tick () |
void | client_resume_after_pause () |
void | client_thread_tick (const std::string &sync_name) |
std::string | get_client_name () const |
PStatCollector | get_collector (int index) const |
std::string | get_collector_fullname (int index) const |
std::string | get_collector_name (int index) const |
PStatThread | get_current_thread () const |
PStatThread | get_main_thread () const |
double | get_max_rate () const |
int | get_num_threads () const |
Returns the total number of threads the Client knows about. | |
double | get_real_time () const |
PStatThread | get_thread (int index) const |
std::string | get_thread_name (int index) const |
Returns the name of the indicated thread. | |
std::string | get_thread_sync_name (int index) const |
Returns the sync_name of the indicated thread. | |
PT (Thread) get_thread_object(int index) const | |
void | set_client_name (const std::string &name) |
void | set_max_rate (double rate) |
Static Public Member Functions | |
static bool | connect (const std::string &=std::string(), int=-1) |
static void | disconnect () |
Closes the connection previously established. | |
static PStatClient * | get_global_pstats () |
static bool | is_connected () |
Returns true if the client believes it is connected to a working PStatServer, false otherwise. | |
static void | main_tick () |
static void | resume_after_pause () |
Resumes the PStatClient after the simulation has been paused for a while. | |
static void | thread_tick (const std::string &) |
Manages the communications to report statistics via a network connection to a remote PStatServer.
Normally, there is only one PStatClient in the world, although it is possible to have multiple PStatClients if extraordinary circumstances require in. Since each PStatCollector registers itself with the PStatClient when it is created, having multiple PStatClients requires special care when constructing the various PStatCollectors.
If DO_PSTATS is not defined, we don't want to use stats at all. This class is therefore defined as a stub class.
Definition at line 266 of file pStatClient.h.
|
inline |
Definition at line 268 of file pStatClient.h.
|
inline |
Definition at line 269 of file pStatClient.h.
bool PStatClient::client_connect | ( | std::string | hostname, |
int | port ) |
Definition at line 1306 of file pStatClient.cxx.
void PStatClient::client_disconnect | ( | ) |
Definition at line 1311 of file pStatClient.cxx.
bool PStatClient::client_is_connected | ( | ) | const |
Definition at line 1316 of file pStatClient.cxx.
void PStatClient::client_main_tick | ( | ) |
Definition at line 1298 of file pStatClient.cxx.
void PStatClient::client_resume_after_pause | ( | ) |
Definition at line 1321 of file pStatClient.cxx.
void PStatClient::client_thread_tick | ( | const std::string & | sync_name | ) |
Definition at line 1302 of file pStatClient.cxx.
|
inlinestatic |
Definition at line 292 of file pStatClient.h.
|
inlinestatic |
Closes the connection previously established.
Definition at line 293 of file pStatClient.h.
Referenced by GraphicsEngine::remove_all_windows().
std::string PStatClient::get_client_name | ( | ) | const |
Definition at line 1231 of file pStatClient.cxx.
PStatCollector PStatClient::get_collector | ( | int | index | ) | const |
Definition at line 1245 of file pStatClient.cxx.
std::string PStatClient::get_collector_fullname | ( | int | index | ) | const |
Definition at line 1255 of file pStatClient.cxx.
std::string PStatClient::get_collector_name | ( | int | index | ) | const |
Definition at line 1250 of file pStatClient.cxx.
PStatThread PStatClient::get_current_thread | ( | ) | const |
Definition at line 1275 of file pStatClient.cxx.
|
static |
Definition at line 1326 of file pStatClient.cxx.
PStatThread PStatClient::get_main_thread | ( | ) | const |
Definition at line 1270 of file pStatClient.cxx.
double PStatClient::get_max_rate | ( | ) | const |
Definition at line 1240 of file pStatClient.cxx.
|
inline |
Returns the total number of threads the Client knows about.
Definition at line 280 of file pStatClient.h.
double PStatClient::get_real_time | ( | ) | const |
Definition at line 1265 of file pStatClient.cxx.
PStatThread PStatClient::get_thread | ( | int | index | ) | const |
Definition at line 1260 of file pStatClient.cxx.
|
inline |
Returns the name of the indicated thread.
Definition at line 282 of file pStatClient.h.
|
inline |
Returns the sync_name of the indicated thread.
Definition at line 283 of file pStatClient.h.
|
inlinestatic |
Returns true if the client believes it is connected to a working PStatServer, false otherwise.
Definition at line 294 of file pStatClient.h.
Referenced by GeomCacheManager::evict_old_entries(), PT(), GeomCacheEntry::refresh(), and GraphicsEngine::render_frame().
|
static |
Definition at line 1290 of file pStatClient.cxx.
|
inline |
Definition at line 284 of file pStatClient.h.
|
inlinestatic |
Resumes the PStatClient after the simulation has been paused for a while.
This allows the stats to continue exactly where it left off, instead of leaving a big gap that would represent a chug.
Definition at line 295 of file pStatClient.h.
void PStatClient::set_client_name | ( | const std::string & | name | ) |
Definition at line 1227 of file pStatClient.cxx.
void PStatClient::set_max_rate | ( | double | rate | ) |
Definition at line 1236 of file pStatClient.cxx.
|
static |
Definition at line 1294 of file pStatClient.cxx.