group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
ClientPerfRecorder Class Reference

Session recorder enabled by GROUP2_CLIENT_PERF=1. More...

#include <ClientPerfRecorder.hpp>

Public Member Functions

void configureFromEnv (const char *basePath)
void start ()
void stop ()
void record (const ClientPerfFrame &frame)
bool isEnabled () const noexcept
bool isRecording () const noexcept
const std::string & sessionDir () const noexcept

Private Member Functions

void writeFramesCsv () const
void writeSummary () const

Private Attributes

bool enabled_ = false
bool recording_ = false
std::size_t reserveFrames_ = 240000
std::uint64_t framesBeyondInitialReserve_ = 0
std::string baseDir_
std::string sessionDir_
std::vector< ClientPerfFrameframes_

Detailed Description

Session recorder enabled by GROUP2_CLIENT_PERF=1.

The recorder does not write from the frame loop. Frames are appended to a pre-reserved vector and flushed to disk on quit, keeping the measured stutter profile free from profiler file I/O.

Member Function Documentation

◆ configureFromEnv()

void ClientPerfRecorder::configureFromEnv ( const char * basePath)

◆ isEnabled()

bool ClientPerfRecorder::isEnabled ( ) const
inlinenodiscardnoexcept

◆ isRecording()

bool ClientPerfRecorder::isRecording ( ) const
inlinenodiscardnoexcept

◆ record()

void ClientPerfRecorder::record ( const ClientPerfFrame & frame)

◆ sessionDir()

const std::string & ClientPerfRecorder::sessionDir ( ) const
inlinenodiscardnoexcept

◆ start()

void ClientPerfRecorder::start ( )
Here is the call graph for this function:

◆ stop()

void ClientPerfRecorder::stop ( )
Here is the call graph for this function:

◆ writeFramesCsv()

void ClientPerfRecorder::writeFramesCsv ( ) const
private
Here is the caller graph for this function:

◆ writeSummary()

void ClientPerfRecorder::writeSummary ( ) const
private
Here is the caller graph for this function:

Member Data Documentation

◆ baseDir_

std::string ClientPerfRecorder::baseDir_
private

◆ enabled_

bool ClientPerfRecorder::enabled_ = false
private

◆ frames_

std::vector<ClientPerfFrame> ClientPerfRecorder::frames_
private

◆ framesBeyondInitialReserve_

std::uint64_t ClientPerfRecorder::framesBeyondInitialReserve_ = 0
private

◆ recording_

bool ClientPerfRecorder::recording_ = false
private

◆ reserveFrames_

std::size_t ClientPerfRecorder::reserveFrames_ = 240000
private

◆ sessionDir_

std::string ClientPerfRecorder::sessionDir_
private

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