Agora  1.2.0
Agora project
Stats Class Reference

#include <stats.h>

Collaboration diagram for Stats:

Classes

struct  TimeDurationsStats
 

Public Member Functions

 Stats (const Config *const cfg)
 
 ~Stats ()
 
void UpdateStats (size_t frame_id)
 
void SaveToFile ()
 
void PrintSummary ()
 If worker stats collection is enabled, prsize_t a summary of stats. More...
 
void MasterSetTsc (TsType timestamp_type, size_t frame_id)
 
size_t MasterGetTsc (TsType timestamp_type, size_t frame_id) const
 
double MasterGetMsSince (TsType timestamp_type, size_t frame_id) const
 
double MasterGetUsSince (TsType timestamp_type, size_t frame_id) const
 
double MasterGetUsFromRef (TsType timestamp_type, size_t frame_id, size_t reference_tsc) const
 
double MasterGetDeltaMs (TsType timestamp_type_1, TsType timestamp_type_2, size_t frame_id) const
 
double MasterGetDeltaUs (TsType timestamp_type_1, TsType timestamp_type_2, size_t frame_id) const
 
double MasterGetDeltaMs (TsType timestamp_type, size_t frame_id_1, size_t frame_id_2) const
 
double MasterGetDeltaUs (TsType timestamp_type, size_t frame_id_1, size_t frame_id_2) const
 
void PrintPerFrameDone (PrintType print_type, size_t frame_id) const
 
void PrintPerSymbolDone (PrintType print_type, size_t frame_id, size_t symbol_id, size_t sub_count) const
 
void PrintPerTaskDone (PrintType print_type, size_t frame_id, size_t symbol_id, size_t ant_or_sc_id, size_t task_count) const
 
DurationStatGetDurationStat (DoerType doer_type, size_t thread_id)
 
DurationStatGetDurationStatOld (DoerType doer_type, size_t thread_id)
 
size_t LastFrameId () const
 
Table< size_t > & FrameStart ()
 

Private Member Functions

void PopulateSummary (FrameSummary *frame_summary, size_t thread_id, DoerType doer_type)
 
size_t GetTotalTaskCount (DoerType doer_type, size_t thread_num)
 

Static Private Member Functions

static void ComputeAvgOverThreads (FrameSummary *frame_summary, size_t thread_num, size_t break_down_num)
 
static void PrintPerThreadPerTask (std::string const &doer_string, FrameSummary const &s)
 
static std::string PrintPerFrame (std::string const &doer_string, FrameSummary const &frame_summary)
 

Private Attributes

const Config *const config_
 
const size_t task_thread_num_
 
const size_t fft_thread_num_
 
const size_t beam_thread_num_
 
const size_t demul_thread_num_
 
const size_t decode_thread_num_
 
const size_t break_down_num_ = kMaxStatBreakdown
 
const double freq_ghz_
 
const size_t creation_tsc_
 
std::array< std::array< double, kNumStatsFrames >, kNumTimestampTypesmaster_timestamps_
 
std::array< TimeDurationsStats, kMaxThreadsworker_durations_
 
std::array< TimeDurationsStats, kMaxThreadsworker_durations_old_
 
std::array< std::array< double, kNumStatsFrames >, kNumDoerTypesdoer_us_
 
std::array< std::array< std::array< double, kNumStatsFrames >, kMaxStatBreakdown >, kNumDoerTypesdoer_breakdown_us_
 
size_t last_frame_id_
 
Table< size_t > frame_start_
 

Constructor & Destructor Documentation

◆ Stats()

Stats::Stats ( const Config *const  cfg)
explicit
Here is the call graph for this function:

◆ ~Stats()

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

Member Function Documentation

◆ ComputeAvgOverThreads()

void Stats::ComputeAvgOverThreads ( FrameSummary frame_summary,
size_t  thread_num,
size_t  break_down_num 
)
staticprivate
Here is the caller graph for this function:

◆ FrameStart()

Table<size_t>& Stats::FrameStart ( )
inline

Dimensions = number of packet RX threads x kNumStatsFrames. frame_start[i][j] is the RDTSC timestamp taken by thread i when it starts receiving frame j.

◆ GetDurationStat()

DurationStat* Stats::GetDurationStat ( DoerType  doer_type,
size_t  thread_id 
)
inline

Get the DurationStat object used by thread thread_id for DoerType doer_type

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDurationStatOld()

DurationStat* Stats::GetDurationStatOld ( DoerType  doer_type,
size_t  thread_id 
)
inline

The master thread uses a stale copy of DurationStats to compute differences. This gets the DurationStat object for thread thread_id for DoerType doer_type.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTotalTaskCount()

size_t Stats::GetTotalTaskCount ( DoerType  doer_type,
size_t  thread_num 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LastFrameId()

size_t Stats::LastFrameId ( ) const
inline

◆ MasterGetDeltaMs() [1/2]

double Stats::MasterGetDeltaMs ( TsType  timestamp_type,
size_t  frame_id_1,
size_t  frame_id_2 
) const
inline

From the master, get the microsecond difference between the times that a timestamp type was taken for two frames

Here is the call graph for this function:

◆ MasterGetDeltaMs() [2/2]

double Stats::MasterGetDeltaMs ( TsType  timestamp_type_1,
TsType  timestamp_type_2,
size_t  frame_id 
) const
inline

From the master, for a frame ID, get the millisecond difference between two timestamp types

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MasterGetDeltaUs() [1/2]

double Stats::MasterGetDeltaUs ( TsType  timestamp_type,
size_t  frame_id_1,
size_t  frame_id_2 
) const
inline

From the master, get the microsecond difference between the times that a timestamp type was taken for two frames

Here is the call graph for this function:

◆ MasterGetDeltaUs() [2/2]

double Stats::MasterGetDeltaUs ( TsType  timestamp_type_1,
TsType  timestamp_type_2,
size_t  frame_id 
) const
inline

From the master, for a frame ID, get the microsecond difference between two timestamp types

Here is the call graph for this function:

◆ MasterGetMsSince()

double Stats::MasterGetMsSince ( TsType  timestamp_type,
size_t  frame_id 
) const
inline

From the master, get the millisecond elapsed since the timestamp of timestamp_type was taken for frame_id

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MasterGetTsc()

size_t Stats::MasterGetTsc ( TsType  timestamp_type,
size_t  frame_id 
) const
inline

From the master, get the RDTSC timestamp for a frame ID and timestamp type

Here is the caller graph for this function:

◆ MasterGetUsFromRef()

double Stats::MasterGetUsFromRef ( TsType  timestamp_type,
size_t  frame_id,
size_t  reference_tsc 
) const
inline

From the master, get the microseconds between when the timestamp of timestamp_type was taken for frame_id, and reference_tsc

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MasterGetUsSince()

double Stats::MasterGetUsSince ( TsType  timestamp_type,
size_t  frame_id 
) const
inline

From the master, get the microseconds elapsed since the timestamp of timestamp_type was taken for frame_id

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MasterSetTsc()

void Stats::MasterSetTsc ( TsType  timestamp_type,
size_t  frame_id 
)
inline

From the master, set the RDTSC timestamp for a frame ID and timestamp type

Here is the call graph for this function:

◆ PopulateSummary()

void Stats::PopulateSummary ( FrameSummary frame_summary,
size_t  thread_id,
DoerType  doer_type 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintPerFrame()

std::string Stats::PrintPerFrame ( std::string const &  doer_string,
FrameSummary const &  frame_summary 
)
staticprivate
Here is the caller graph for this function:

◆ PrintPerFrameDone()

void Stats::PrintPerFrameDone ( PrintType  print_type,
size_t  frame_id 
) const
Here is the call graph for this function:

◆ PrintPerSymbolDone()

void Stats::PrintPerSymbolDone ( PrintType  print_type,
size_t  frame_id,
size_t  symbol_id,
size_t  sub_count 
) const
Here is the call graph for this function:

◆ PrintPerTaskDone()

void Stats::PrintPerTaskDone ( PrintType  print_type,
size_t  frame_id,
size_t  symbol_id,
size_t  ant_or_sc_id,
size_t  task_count 
) const

◆ PrintPerThreadPerTask()

void Stats::PrintPerThreadPerTask ( std::string const &  doer_string,
FrameSummary const &  s 
)
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintSummary()

void Stats::PrintSummary ( )

If worker stats collection is enabled, prsize_t a summary of stats.

Here is the call graph for this function:

◆ SaveToFile()

void Stats::SaveToFile ( )

Save master timestamps to a file. If worker stats collection is enabled, also save detailed worker timing info to a file.

Here is the call graph for this function:

◆ UpdateStats()

void Stats::UpdateStats ( size_t  frame_id)

If worker stats collection is enabled, combine and update per-worker stats for all uplink and donwlink Doer types. Else return immediately.

Here is the call graph for this function:

Member Data Documentation

◆ beam_thread_num_

const size_t Stats::beam_thread_num_
private

◆ break_down_num_

const size_t Stats::break_down_num_ = kMaxStatBreakdown
private

◆ config_

const Config* const Stats::config_
private

◆ creation_tsc_

const size_t Stats::creation_tsc_
private

◆ decode_thread_num_

const size_t Stats::decode_thread_num_
private

◆ demul_thread_num_

const size_t Stats::demul_thread_num_
private

◆ doer_breakdown_us_

std::array<std::array<std::array<double, kNumStatsFrames>, kMaxStatBreakdown>, kNumDoerTypes> Stats::doer_breakdown_us_
private

◆ doer_us_

std::array<std::array<double, kNumStatsFrames>, kNumDoerTypes> Stats::doer_us_
private

◆ fft_thread_num_

const size_t Stats::fft_thread_num_
private

◆ frame_start_

Table<size_t> Stats::frame_start_
private

Dimensions = number of packet RX threads x kNumStatsFrames. frame_start[i][j] is the RDTSC timestamp taken by thread i when it starts receiving frame j.

◆ freq_ghz_

const double Stats::freq_ghz_
private

◆ last_frame_id_

size_t Stats::last_frame_id_
private

◆ master_timestamps_

std::array<std::array<double, kNumStatsFrames>, kNumTimestampTypes> Stats::master_timestamps_
private

Timestamps taken by the master thread at different points in a frame's processing

◆ task_thread_num_

const size_t Stats::task_thread_num_
private

◆ worker_durations_

std::array<TimeDurationsStats, kMaxThreads> Stats::worker_durations_
private

◆ worker_durations_old_

std::array<TimeDurationsStats, kMaxThreads> Stats::worker_durations_old_
private

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