X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=print_latency.h;h=3e1c4060f530a204cb419a6166f2ec675987747e;hb=fa54f2630c56a1df0046923d6a77b1bd58abf240;hp=0e880ca1e75273d2018c594c3a08dd77cb8e8cb9;hpb=8c5fb6a77a16f30a32121971db749a211f8050ad;p=nageru diff --git a/print_latency.h b/print_latency.h index 0e880ca..3e1c406 100644 --- a/print_latency.h +++ b/print_latency.h @@ -10,17 +10,23 @@ #include #include "ref_counted_frame.h" +#include "metrics.h" // Since every output frame is based on multiple input frames, we need -// more than one start timestamp. For now, we keep just the smallest -// and largest timestamp, so that we can print out a range. -// For both of these, steady_clock::time_point::min() is used for “not set”. +// more than one start timestamp; one for each input. +// For all of these, steady_clock::time_point::min() is used for “not set”. struct ReceivedTimestamps { - std::chrono::steady_clock::time_point min_ts, max_ts; + std::vector ts; +}; +struct LatencyHistogram { + void init(const std::string &measuring_point); // Initializes histograms and registers them in global_metrics. + + // Indices: card number, frame history number, b-frame or not (1/0, where 2 counts both). + std::vector>> summaries; }; ReceivedTimestamps find_received_timestamp(const std::vector &input_frames); -void print_latency(const std::string &header, const ReceivedTimestamps &received_ts, bool is_b_frame, int *frameno); +void print_latency(const std::string &header, const ReceivedTimestamps &received_ts, bool is_b_frame, int *frameno, LatencyHistogram *histogram); #endif // !defined(_PRINT_LATENCY_H)