From 8b5560218adfee6406eafd3c09cb44a29f2e40a5 Mon Sep 17 00:00:00 2001 From: Bjorn Terelius Date: Tue, 27 Nov 2018 15:43:01 +0100 Subject: [PATCH] Batch RTC event log output if using the new wire format. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new wire format doesn't have much effect on compression unless the log is encoded in reasonably large batches. PeerConnection has two functions to start logging; one which takes an output period (or batch size) in milliseconds and one which uses a default period instead. This CL changes the default batch size to 5 seconds if the the new format is enabled as a field trial. Bug: webrtc:8111 Change-Id: I638f6114325251b6a9acf4f863afe2688a3b0522 Reviewed-on: https://webrtc-review.googlesource.com/c/112130 Reviewed-by: Steve Anton Commit-Queue: Björn Terelius Cr-Commit-Position: refs/heads/master@{#25803} --- pc/peerconnection.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc index e60474ca1d..9549c42830 100644 --- a/pc/peerconnection.cc +++ b/pc/peerconnection.cc @@ -3311,9 +3311,13 @@ bool PeerConnection::StartRtcEventLog(rtc::PlatformFile file, const size_t max_size = (max_size_bytes < 0) ? RtcEventLog::kUnlimitedOutput : rtc::saturated_cast(max_size_bytes); + int64_t output_period_ms = webrtc::RtcEventLog::kImmediateOutput; + if (field_trial::IsEnabled("WebRTC-RtcEventLogNewFormat")) { + output_period_ms = 5000; + } return StartRtcEventLog( absl::make_unique(file, max_size), - webrtc::RtcEventLog::kImmediateOutput); + output_period_ms); } bool PeerConnection::StartRtcEventLog(std::unique_ptr output,