Pioneer
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
Perf::Stats Class Reference

#include <PerfStats.h>

Inheritance diagram for Perf::Stats:
Inheritance graph
[legend]

Classes

struct  CounterRef
 

Public Types

using FrameInfo = std::map< std::string, uint32_t >
 

Public Member Functions

CounterRef GetOrCreateCounter (std::string name, bool resetOnNewFrame=true)
 
void CounterAdd (CounterRef ref, uint32_t amount=1) const
 
void CounterDec (CounterRef ref, uint32_t amount=1) const
 
void CounterSet (CounterRef ref, uint32_t value) const
 
void CounterReset (CounterRef ref) const
 
void EnableReset (bool enabled)
 
const FrameInfoGetFrameStats () const
 
std::string GetNameForCounter (CounterRef ref) const
 
void FlushFrame ()
 

Detailed Description

Simple atomic counter implementation for performance counters.

Create counters by calling auto ref = stats->GetOrCreateCounter("Triangles Drawn"). Once you have a counter reference, you can call stats->CounterAdd(ref, 12) to update the counter. The Counter* functions are thread-safe so long as they are called with a proper CounterRef. Call FlushFrame() to collate all stats from the current frame and write them to the frame cache.

Member Typedef Documentation

◆ FrameInfo

using Perf::Stats::FrameInfo = std::map<std::string, uint32_t>

Member Function Documentation

◆ CounterAdd()

void Perf::Stats::CounterAdd ( CounterRef  ref,
uint32_t  amount = 1 
) const
inline

◆ CounterDec()

void Perf::Stats::CounterDec ( CounterRef  ref,
uint32_t  amount = 1 
) const
inline

◆ CounterReset()

void Perf::Stats::CounterReset ( CounterRef  ref) const
inline

◆ CounterSet()

void Perf::Stats::CounterSet ( CounterRef  ref,
uint32_t  value 
) const
inline

◆ EnableReset()

void Perf::Stats::EnableReset ( bool  enabled)
inline

◆ FlushFrame()

void Stats::FlushFrame ( )
Here is the call graph for this function:

◆ GetFrameStats()

const FrameInfo & Perf::Stats::GetFrameStats ( ) const
inline

◆ GetNameForCounter()

std::string Perf::Stats::GetNameForCounter ( CounterRef  ref) const
inline

◆ GetOrCreateCounter()

Stats::CounterRef Stats::GetOrCreateCounter ( std::string  name,
bool  resetOnNewFrame = true 
)

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