Add a method to log AnalyzingVideoSink metrics.
Change-Id: I19a954f4341c6581d89a8fecf8f2646bb3fe46f4 Bug: b/282154243 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310140 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Jeremy Leconte <jleconte@google.com> Cr-Commit-Position: refs/heads/main@{#40353}
This commit is contained in:
parent
34589929fe
commit
9a3ab3dcca
@ -345,10 +345,13 @@ rtc_library("analyzing_video_sink") {
|
||||
":analyzing_video_sinks_helper",
|
||||
":simulcast_dummy_buffer_helper",
|
||||
":video_dumping",
|
||||
"../..:metric_metadata_keys",
|
||||
"../../../..:fixed_fps_video_frame_writer_adapter",
|
||||
"../../../..:test_renderer",
|
||||
"../../../../../api:video_quality_analyzer_api",
|
||||
"../../../../../api/numerics",
|
||||
"../../../../../api/test/metrics:metric",
|
||||
"../../../../../api/test/metrics:metrics_logger",
|
||||
"../../../../../api/test/pclf:media_configuration",
|
||||
"../../../../../api/test/video:video_frame_writer",
|
||||
"../../../../../api/units:timestamp",
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/test/metrics/metric.h"
|
||||
#include "api/test/metrics/metrics_logger.h"
|
||||
#include "api/test/pclf/media_configuration.h"
|
||||
#include "api/test/video/video_frame_writer.h"
|
||||
#include "api/units/timestamp.h"
|
||||
@ -26,6 +28,7 @@
|
||||
#include "rtc_base/synchronization/mutex.h"
|
||||
#include "test/pc/e2e/analyzer/video/simulcast_dummy_buffer_helper.h"
|
||||
#include "test/pc/e2e/analyzer/video/video_dumping.h"
|
||||
#include "test/pc/e2e/metric_metadata_keys.h"
|
||||
#include "test/testsupport/fixed_fps_video_frame_writer_adapter.h"
|
||||
#include "test/video_renderer.h"
|
||||
|
||||
@ -108,6 +111,26 @@ void AnalyzingVideoSink::OnFrame(const VideoFrame& frame) {
|
||||
}
|
||||
}
|
||||
|
||||
void AnalyzingVideoSink::LogMetrics(webrtc::test::MetricsLogger& metrics_logger,
|
||||
absl::string_view test_case_name) const {
|
||||
if (report_infra_stats_) {
|
||||
MutexLock lock(&mutex_);
|
||||
const std::string test_case(test_case_name);
|
||||
// TODO(bugs.webrtc.org/14757): Remove kExperimentalTestNameMetadataKey.
|
||||
std::map<std::string, std::string> metadata = {
|
||||
{MetricMetadataKey::kPeerMetadataKey, peer_name_},
|
||||
{MetricMetadataKey::kExperimentalTestNameMetadataKey, test_case}};
|
||||
metrics_logger.LogMetric(
|
||||
"analyzing_sink_processing_time_ms", test_case + "/" + peer_name_,
|
||||
stats_.analyzing_sink_processing_time_ms, test::Unit::kMilliseconds,
|
||||
test::ImprovementDirection::kSmallerIsBetter, metadata);
|
||||
metrics_logger.LogMetric("scaling_tims_ms", test_case + "/" + peer_name_,
|
||||
stats_.scaling_tims_ms, test::Unit::kMilliseconds,
|
||||
test::ImprovementDirection::kSmallerIsBetter,
|
||||
metadata);
|
||||
}
|
||||
}
|
||||
|
||||
AnalyzingVideoSink::Stats AnalyzingVideoSink::stats() const {
|
||||
MutexLock lock(&mutex_);
|
||||
return stats_;
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/numerics/samples_stats_counter.h"
|
||||
#include "api/test/metrics/metrics_logger.h"
|
||||
#include "api/test/pclf/media_configuration.h"
|
||||
#include "api/test/video/video_frame_writer.h"
|
||||
#include "api/test/video_quality_analyzer_interface.h"
|
||||
@ -56,6 +57,9 @@ class AnalyzingVideoSink : public rtc::VideoSinkInterface<VideoFrame> {
|
||||
|
||||
void OnFrame(const VideoFrame& frame) override;
|
||||
|
||||
void LogMetrics(webrtc::test::MetricsLogger& metrics_logger,
|
||||
absl::string_view test_case_name) const;
|
||||
|
||||
Stats stats() const;
|
||||
|
||||
private:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user