Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
PStatClient Class Reference

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 PStatClientget_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 &)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PStatClient()

PStatClient::PStatClient ( )
inline

Definition at line 268 of file pStatClient.h.

◆ ~PStatClient()

PStatClient::~PStatClient ( )
inline

Definition at line 269 of file pStatClient.h.

Member Function Documentation

◆ client_connect()

bool PStatClient::client_connect ( std::string hostname,
int port )

Definition at line 1306 of file pStatClient.cxx.

◆ client_disconnect()

void PStatClient::client_disconnect ( )

Definition at line 1311 of file pStatClient.cxx.

◆ client_is_connected()

bool PStatClient::client_is_connected ( ) const

Definition at line 1316 of file pStatClient.cxx.

◆ client_main_tick()

void PStatClient::client_main_tick ( )

Definition at line 1298 of file pStatClient.cxx.

◆ client_resume_after_pause()

void PStatClient::client_resume_after_pause ( )

Definition at line 1321 of file pStatClient.cxx.

◆ client_thread_tick()

void PStatClient::client_thread_tick ( const std::string & sync_name)

Definition at line 1302 of file pStatClient.cxx.

◆ connect()

static bool PStatClient::connect ( const std::string & = std::string(),
int = -1 )
inlinestatic

Definition at line 292 of file pStatClient.h.

◆ disconnect()

void PStatClient::disconnect ( )
inlinestatic

Closes the connection previously established.

Definition at line 293 of file pStatClient.h.

Referenced by GraphicsEngine::remove_all_windows().

◆ get_client_name()

std::string PStatClient::get_client_name ( ) const

Definition at line 1231 of file pStatClient.cxx.

◆ get_collector()

PStatCollector PStatClient::get_collector ( int index) const

Definition at line 1245 of file pStatClient.cxx.

◆ get_collector_fullname()

std::string PStatClient::get_collector_fullname ( int index) const

Definition at line 1255 of file pStatClient.cxx.

◆ get_collector_name()

std::string PStatClient::get_collector_name ( int index) const

Definition at line 1250 of file pStatClient.cxx.

◆ get_current_thread()

PStatThread PStatClient::get_current_thread ( ) const

Definition at line 1275 of file pStatClient.cxx.

◆ get_global_pstats()

PStatClient * PStatClient::get_global_pstats ( )
static

Definition at line 1326 of file pStatClient.cxx.

◆ get_main_thread()

PStatThread PStatClient::get_main_thread ( ) const

Definition at line 1270 of file pStatClient.cxx.

◆ get_max_rate()

double PStatClient::get_max_rate ( ) const

Definition at line 1240 of file pStatClient.cxx.

◆ get_num_threads()

int PStatClient::get_num_threads ( ) const
inline

Returns the total number of threads the Client knows about.

Definition at line 280 of file pStatClient.h.

◆ get_real_time()

double PStatClient::get_real_time ( ) const

Definition at line 1265 of file pStatClient.cxx.

◆ get_thread()

PStatThread PStatClient::get_thread ( int index) const

Definition at line 1260 of file pStatClient.cxx.

◆ get_thread_name()

std::string PStatClient::get_thread_name ( int index) const
inline

Returns the name of the indicated thread.

Definition at line 282 of file pStatClient.h.

◆ get_thread_sync_name()

std::string PStatClient::get_thread_sync_name ( int index) const
inline

Returns the sync_name of the indicated thread.

Definition at line 283 of file pStatClient.h.

◆ is_connected()

bool PStatClient::is_connected ( )
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().

◆ main_tick()

void PStatClient::main_tick ( )
static

Definition at line 1290 of file pStatClient.cxx.

◆ PT()

PStatClient::PT ( Thread ) const
inline

Definition at line 284 of file pStatClient.h.

◆ resume_after_pause()

void PStatClient::resume_after_pause ( )
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.

◆ set_client_name()

void PStatClient::set_client_name ( const std::string & name)

Definition at line 1227 of file pStatClient.cxx.

◆ set_max_rate()

void PStatClient::set_max_rate ( double rate)

Definition at line 1236 of file pStatClient.cxx.

◆ thread_tick()

void PStatClient::thread_tick ( const std::string & )
static

Definition at line 1294 of file pStatClient.cxx.


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