Tramway SDK
Classes | Enumerations | Functions
tram::Stats Namespace Reference

Resource usage statistics. More...

Classes

struct  SystemStat
 

Enumerations

enum  Resource : uint32_t { RESOURCE_VRAM , RESOURCE_DRAWCALL }
 

Functions

void Start (System::system_t system)
 Starts counting time spent on a system. More...
 
void Stop (System::system_t system)
 Stops counting time spent on a system. More...
 
void Add (Resource resource, size_t ammount)
 Adds an ammount of a resource. More...
 
void Remove (Resource resource, size_t ammount)
 Removes an ammount of a resource. More...
 
void Collate ()
 Collates all of the time statistics. More...
 
size_t GetStat (Resource resource)
 Returns the uncollated ammount of a resource. More...
 
double GetStat (System::system_t system)
 Returns the collated time of a system. More...
 
double GetStatUncollated (System::system_t system)
 Returns the uncollated time of a system. More...
 
double GetStatAverage (System::system_t system)
 Returns the ammount of resource, averaged over the last second. More...
 

Detailed Description

Resource usage statistics.

Keeps track of resource usage, time spent by different systems, as well as various other counters.

See also
https://racenis.github.io/tram-sdk/documentation/framework/stats.html

Enumeration Type Documentation

◆ Resource

enum tram::Stats::Resource : uint32_t
Enumerator
RESOURCE_VRAM 
RESOURCE_DRAWCALL 

Function Documentation

◆ Add()

void tram::Stats::Add ( Resource  resource,
size_t  ammount 
)

Adds an ammount of a resource.

◆ Collate()

void tram::Stats::Collate ( )

Collates all of the time statistics.

◆ GetStat() [1/2]

size_t tram::Stats::GetStat ( Resource  resource)

Returns the uncollated ammount of a resource.

◆ GetStat() [2/2]

double tram::Stats::GetStat ( System::system_t  system)

Returns the collated time of a system.

◆ GetStatAverage()

double tram::Stats::GetStatAverage ( System::system_t  system)

Returns the ammount of resource, averaged over the last second.

◆ GetStatUncollated()

double tram::Stats::GetStatUncollated ( System::system_t  system)

Returns the uncollated time of a system.

◆ Remove()

void tram::Stats::Remove ( Resource  resource,
size_t  ammount 
)

Removes an ammount of a resource.

◆ Start()

void tram::Stats::Start ( System::system_t  system)

Starts counting time spent on a system.

◆ Stop()

void tram::Stats::Stop ( System::system_t  system)

Stops counting time spent on a system.