AJA NTV2 SDK  17.1.3.1410
NTV2 SDK 17.1.3.1410
AJADebugStat Class Reference

#include <debugshare.h>

Public Member Functions

 AJADebugStat ()
 
void Reset (void)
 
bool operator== (const AJADebugStat &inRHS) const
 
double Average (void) const
 
uint64_t Sum (size_t inNum=11) const
 
uint32_t Minimum (size_t inNum=11) const
 
uint32_t Maximum (size_t inNum=11) const
 
void Start (void)
 
bool Stop (void)
 
bool IncrementCount (const uint32_t inIncrement=1, const bool inRollOver=true)
 
bool DecrementCount (const uint32_t inDecrement=1, const bool inRollUnder=true)
 
void SetValue (const uint32_t inValue)
 

Static Public Member Functions

static std::string StatKeyName (const int inKey)
 
static bool StatKeyHasName (const int inKey)
 
static bool SetStatKeyName (const int inKey, const std::string &inName)
 
static std::vector< int > NamedStatKeys (void)
 

Public Attributes

uint32_t fMin
 
uint32_t fMax
 
uint32_t volatile fCount
 
uint64_t fLastTimeStamp
 
uint32_t fValues [11]
 

Detailed Description

64-byte structure representing an unsigned 32-bit measurement (timer, counter or data value). As a timer, it stores minimum, maximum and average elapsed time in microseconds. As a data value, it stores minimum, maximum, moving average value, and last update usec timestamp. As a counter, it can increment or decrement, with or without rollover/rollunder.

Definition at line 262 of file debugshare.h.

Constructor & Destructor Documentation

◆ AJADebugStat()

AJADebugStat::AJADebugStat ( )
inline

Definition at line 273 of file debugshare.h.

Member Function Documentation

◆ Average()

double AJADebugStat::Average ( void  ) const

Returns the average of the stored values

Definition at line 1335 of file debug.cpp.

◆ DecrementCount()

bool AJADebugStat::DecrementCount ( const uint32_t  inDecrement = 1,
const bool  inRollUnder = true 
)

Decrements fCount by the given amount, and sets fLastTimeStamp if successful.

Parameters
[in]inDecrementOptionally specifies a different increment value. Defaults to 1.
[in]inRollUnderOptionally controls if underflow is permitted. Defaults to true.

Definition at line 1373 of file debug.cpp.

◆ IncrementCount()

bool AJADebugStat::IncrementCount ( const uint32_t  inIncrement = 1,
const bool  inRollOver = true 
)

Increments fCount by the given amount, and sets fLastTimeStamp if successful.

Parameters
[in]inIncrementOptionally specifies a different increment value. Defaults to 1.
[in]inRollOverOptionally controls if overflow is permitted. Defaults to true.

Definition at line 1360 of file debug.cpp.

◆ Maximum()

uint32_t AJADebugStat::Maximum ( size_t  inNum = 11) const

Returns the maximum of the first "inNum" stored values

Definition at line 1322 of file debug.cpp.

◆ Minimum()

uint32_t AJADebugStat::Minimum ( size_t  inNum = 11) const

Returns the minimum of the first "inNum" stored values

Definition at line 1309 of file debug.cpp.

◆ NamedStatKeys()

vector< int > AJADebugStat::NamedStatKeys ( void  )
static

Definition at line 1486 of file debug.cpp.

◆ operator==()

bool AJADebugStat::operator== ( const AJADebugStat inRHS) const

Returns true if equal to RHS

Definition at line 1396 of file debug.cpp.

◆ Reset()

void AJADebugStat::Reset ( void  )
inline

Definition at line 275 of file debugshare.h.

◆ SetStatKeyName()

bool AJADebugStat::SetStatKeyName ( const int  inKey,
const std::string &  inName 
)
static

Definition at line 1466 of file debug.cpp.

◆ SetValue()

void AJADebugStat::SetValue ( const uint32_t  inValue)

Stores the given value in the deque, bumps fCount, and sets fLastTimeStamp.

Definition at line 1386 of file debug.cpp.

◆ Start()

void AJADebugStat::Start ( void  )

Starts a timer by setting fLastTimeStamp to the high-resolution host OS system timestamp

Definition at line 1344 of file debug.cpp.

◆ StatKeyHasName()

static bool AJADebugStat::StatKeyHasName ( const int  inKey)
inlinestatic

Definition at line 316 of file debugshare.h.

◆ StatKeyName()

string AJADebugStat::StatKeyName ( const int  inKey)
static

Definition at line 1457 of file debug.cpp.

◆ Stop()

bool AJADebugStat::Stop ( void  )

Stops timer, stores elapsed time in the deque, bumps fCount, clears fLastTimeStamp, and updates fMin/fMax if needed.

Definition at line 1349 of file debug.cpp.

◆ Sum()

uint64_t AJADebugStat::Sum ( size_t  inNum = 11) const

Returns the sum of the first "inNum" stored values

Definition at line 1297 of file debug.cpp.

Member Data Documentation

◆ fCount

uint32_t volatile AJADebugStat::fCount

Update/change count

Definition at line 267 of file debugshare.h.

◆ fLastTimeStamp

uint64_t AJADebugStat::fLastTimeStamp

Timestamp (start time for timer, zero if not running; last update time for counter or data value)

Definition at line 268 of file debugshare.h.

◆ fMax

uint32_t AJADebugStat::fMax

Largest value yet seen. (Fixed at zero and unused for counters.)

Definition at line 266 of file debugshare.h.

◆ fMin

uint32_t AJADebugStat::fMin

Smallest value yet seen. (Fixed at 0xFFFFFFFF and unused for counters.)

Definition at line 265 of file debugshare.h.

◆ fValues

uint32_t AJADebugStat::fValues[11]

Deque that provides an 11-sample moving average. (Unused for counters.)

Definition at line 269 of file debugshare.h.


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