From: Steinar H. Gunderson Date: Sun, 8 Mar 2020 14:02:21 +0000 (+0100) Subject: Add metrics for how many frames we are decoding, but did not have the time to display. X-Git-Tag: 1.9.2~15 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=02ea864dc5a6dde7450c497581ff18d784ab832c Add metrics for how many frames we are decoding, but did not have the time to display. --- diff --git a/futatabi/jpeg_frame_view.cpp b/futatabi/jpeg_frame_view.cpp index c95a2ce..ebcf509 100644 --- a/futatabi/jpeg_frame_view.cpp +++ b/futatabi/jpeg_frame_view.cpp @@ -72,6 +72,8 @@ atomic metric_jpeg_software_decode_frames{ 0 }; atomic metric_jpeg_software_fail_frames{ 0 }; atomic metric_jpeg_vaapi_decode_frames{ 0 }; atomic metric_jpeg_vaapi_fail_frames{ 0 }; +atomic metric_jpeg_prepared_frames{ 0 }; +atomic metric_jpeg_displayed_frames{ 0 }; Summary metric_jpeg_decode_time_seconds; } // namespace @@ -358,6 +360,8 @@ JPEGFrameView::JPEGFrameView(QWidget *parent) global_metrics.add("jpeg_decode_frames", { { "decoder", "software" }, { "result", "fail" } }, &metric_jpeg_software_fail_frames); global_metrics.add("jpeg_decode_frames", { { "decoder", "vaapi" }, { "result", "decode" } }, &metric_jpeg_vaapi_decode_frames); global_metrics.add("jpeg_decode_frames", { { "decoder", "vaapi" }, { "result", "fail" } }, &metric_jpeg_vaapi_fail_frames); + global_metrics.add("jpeg_frames", { { "action", "prepared" } }, &metric_jpeg_prepared_frames); + global_metrics.add("jpeg_frames", { { "action", "displayed" } }, &metric_jpeg_displayed_frames); vector quantiles{ 0.01, 0.1, 0.25, 0.5, 0.75, 0.9, 0.99 }; metric_jpeg_decode_time_seconds.init(quantiles, 60.0); global_metrics.add("jpeg_decode_time_seconds", &metric_jpeg_decode_time_seconds); @@ -428,6 +432,11 @@ void JPEGFrameView::paintGL() return; } + if (!displayed_this_frame) { + ++metric_jpeg_displayed_frames; + displayed_this_frame = true; + } + check_error(); current_chain->render_to_screen(); @@ -458,6 +467,8 @@ void JPEGFrameView::setDecodedFrame(shared_ptr frame, shared_ptr s } else { current_chain = ycbcr_converter->prepare_chain_for_conversion(frame); } + ++metric_jpeg_prepared_frames; + displayed_this_frame = false; update(); }); } diff --git a/futatabi/jpeg_frame_view.h b/futatabi/jpeg_frame_view.h index 108aa73..3f92e4c 100644 --- a/futatabi/jpeg_frame_view.h +++ b/futatabi/jpeg_frame_view.h @@ -62,6 +62,7 @@ private: std::unique_ptr ycbcr_converter; movit::EffectChain *current_chain = nullptr; // Owned by ycbcr_converter. + bool displayed_this_frame = false; // Owned by the UI frame. std::shared_ptr current_frame; // So that we hold on to the pixels. std::shared_ptr current_secondary_frame; // Same.