ReceivedTimestamps find_received_timestamp(const vector<RefCountedFrame> &input_frames)
{
- unsigned num_cards = global_mixer->get_num_cards();
- assert(input_frames.size() == num_cards * FRAME_HISTORY_LENGTH);
+ assert(input_frames.size() == MAX_VIDEO_CARDS * FRAME_HISTORY_LENGTH);
ReceivedTimestamps ts;
- for (unsigned card_index = 0; card_index < num_cards; ++card_index) {
+ for (unsigned card_index = 0; card_index < MAX_VIDEO_CARDS; ++card_index) {
for (unsigned frame_index = 0; frame_index < FRAME_HISTORY_LENGTH; ++frame_index) {
const RefCountedFrame &input_frame = input_frames[card_index * FRAME_HISTORY_LENGTH + frame_index];
if (input_frame == nullptr ||
void LatencyHistogram::init(const string &measuring_point)
{
- unsigned num_cards = global_flags.num_cards; // The mixer might not be ready yet.
- summaries.resize(num_cards * FRAME_HISTORY_LENGTH * 2);
- for (unsigned card_index = 0; card_index < num_cards; ++card_index) {
+ summaries.resize(MAX_VIDEO_CARDS * FRAME_HISTORY_LENGTH * 2);
+ for (unsigned card_index = 0; card_index < MAX_VIDEO_CARDS; ++card_index) {
char card_index_str[64];
snprintf(card_index_str, sizeof(card_index_str), "%u", card_index);
summaries[card_index].resize(FRAME_HISTORY_LENGTH);
{ "frame_age", frame_index_str },
{ "frame_type", "i/p" }},
&summaries[card_index][frame_index][0],
- (frame_index == 0) ? Metrics::PRINT_ALWAYS : Metrics::PRINT_WHEN_NONEMPTY);
+ Metrics::PRINT_WHEN_NONEMPTY);
global_metrics.add("latency_seconds",
{{ "measuring_point", measuring_point },
{ "card", card_index_str },
{ "frame_age", frame_index_str },
{ "frame_type", "total" }},
&summaries[card_index][frame_index][2],
- (frame_index == 0) ? Metrics::PRINT_ALWAYS : Metrics::PRINT_WHEN_NONEMPTY);
+ Metrics::PRINT_WHEN_NONEMPTY);
}
}
}
histogram->summaries[0][0][2].count_event(latency.count());
}
} else {
- unsigned num_cards = global_mixer->get_num_cards();
- assert(received_ts.ts.size() == num_cards * FRAME_HISTORY_LENGTH);
- for (unsigned card_index = 0; card_index < num_cards; ++card_index) {
+ assert(received_ts.ts.size() == MAX_VIDEO_CARDS * FRAME_HISTORY_LENGTH);
+ for (unsigned card_index = 0; card_index < MAX_VIDEO_CARDS; ++card_index) {
for (unsigned frame_index = 0; frame_index < FRAME_HISTORY_LENGTH; ++frame_index) {
steady_clock::time_point ts = received_ts.ts[card_index * FRAME_HISTORY_LENGTH + frame_index];
if (ts == steady_clock::time_point::min()) {