Panda3D
Public Member Functions | List of all members
CacheStats Class Reference

This is used to track the utilization of the TransformState and RenderState caches, for low-level performance tuning information. More...

#include "cacheStats.h"

Public Member Functions

void add_num_states (int count)
 Adds the indicated count (positive or negative) to the total count of individual RenderState or TransformState objects. More...
 
void add_total_size (int count)
 Adds the indicated count (positive or negative) to the total number of entries for the cache (net occupied size of all the hashtables). More...
 
void inc_adds (bool is_new)
 Increments by 1 the count of elements added to the cache. More...
 
void inc_dels ()
 Increments by 1 the count of elements removed from the cache. More...
 
void inc_hits ()
 Increments by 1 the count of cache hits. More...
 
void inc_misses ()
 Increments by 1 the count of cache misses. More...
 
void init ()
 Initializes the CacheStats for the first time. More...
 
void maybe_report (const char *name)
 Outputs a report if enough time has elapsed. More...
 
void reset (double now)
 Reinitializes just those parts of the CacheStats that should be reset between each reporting interval. More...
 
void write (ostream &out, const char *name) const
 

Detailed Description

This is used to track the utilization of the TransformState and RenderState caches, for low-level performance tuning information.

Definition at line 28 of file cacheStats.h.

Member Function Documentation

◆ add_num_states()

void CacheStats::add_num_states ( int  count)
inline

Adds the indicated count (positive or negative) to the total count of individual RenderState or TransformState objects.

Definition at line 111 of file cacheStats.I.

Referenced by add_total_size().

◆ add_total_size()

void CacheStats::add_total_size ( int  count)
inline

Adds the indicated count (positive or negative) to the total number of entries for the cache (net occupied size of all the hashtables).

Definition at line 97 of file cacheStats.I.

References add_num_states().

Referenced by inc_dels().

◆ inc_adds()

void CacheStats::inc_adds ( bool  is_new)
inline

Increments by 1 the count of elements added to the cache.

If is_new is true, the element was added to a previously empty hashtable.

Definition at line 67 of file cacheStats.I.

References inc_dels().

Referenced by inc_misses().

◆ inc_dels()

void CacheStats::inc_dels ( )
inline

Increments by 1 the count of elements removed from the cache.

Definition at line 83 of file cacheStats.I.

References add_total_size().

Referenced by inc_adds().

◆ inc_hits()

void CacheStats::inc_hits ( )
inline

Increments by 1 the count of cache hits.

Definition at line 41 of file cacheStats.I.

References inc_misses().

Referenced by maybe_report().

◆ inc_misses()

void CacheStats::inc_misses ( )
inline

Increments by 1 the count of cache misses.

Definition at line 53 of file cacheStats.I.

References inc_adds().

Referenced by inc_hits().

◆ init()

void CacheStats::init ( )

Initializes the CacheStats for the first time.

We don't use the constructor for this, since we can't guarantee ordering of static constructors.

Definition at line 25 of file cacheStats.cxx.

References reset().

◆ maybe_report()

void CacheStats::maybe_report ( const char *  name)
inline

Outputs a report if enough time has elapsed.

Definition at line 22 of file cacheStats.I.

References ClockObject::get_global_clock(), ClockObject::get_real_time(), inc_hits(), Notify::out(), and reset().

◆ reset()

void CacheStats::reset ( double  now)

Reinitializes just those parts of the CacheStats that should be reset between each reporting interval.

Definition at line 45 of file cacheStats.cxx.

Referenced by init(), and maybe_report().


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