Log DTLS writable changes to RtcEventLog
Bug: webrtc:9972 Change-Id: I8d29dcbc200bd0aad7f4c2600459c4d344c61bbb Reviewed-on: https://webrtc-review.googlesource.com/c/111453 Reviewed-by: Qingsi Wang <qingsi@webrtc.org> Reviewed-by: Elad Alon <eladalon@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Zach Stein <zstein@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25866}
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
#include "logging/rtc_event_log/events/rtc_event_bwe_update_delay_based.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_dtls_transport_state.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_dtls_writable_state.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_probe_cluster_created.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_probe_result_failure.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_probe_result_success.h"
|
||||
@ -75,6 +76,7 @@ struct EventCounts {
|
||||
size_t bwe_loss_events = 0;
|
||||
size_t bwe_delay_events = 0;
|
||||
size_t dtls_transport_states = 0;
|
||||
size_t dtls_writable_states = 0;
|
||||
size_t probe_creations = 0;
|
||||
size_t probe_successes = 0;
|
||||
size_t probe_failures = 0;
|
||||
@ -87,10 +89,10 @@ struct EventCounts {
|
||||
|
||||
size_t total_nonconfig_events() const {
|
||||
return alr_states + audio_playouts + ana_configs + bwe_loss_events +
|
||||
bwe_delay_events + dtls_transport_states + probe_creations +
|
||||
probe_successes + probe_failures + ice_configs + ice_events +
|
||||
incoming_rtp_packets + outgoing_rtp_packets + incoming_rtcp_packets +
|
||||
outgoing_rtcp_packets;
|
||||
bwe_delay_events + dtls_transport_states + dtls_writable_states +
|
||||
probe_creations + probe_successes + probe_failures + ice_configs +
|
||||
ice_events + incoming_rtp_packets + outgoing_rtp_packets +
|
||||
incoming_rtcp_packets + outgoing_rtcp_packets;
|
||||
}
|
||||
|
||||
size_t total_config_events() const {
|
||||
@ -160,6 +162,8 @@ class RtcEventLogSession
|
||||
std::vector<std::unique_ptr<RtcEventBweUpdateDelayBased>> bwe_delay_list_;
|
||||
std::vector<std::unique_ptr<RtcEventDtlsTransportState>>
|
||||
dtls_transport_state_list_;
|
||||
std::vector<std::unique_ptr<RtcEventDtlsWritableState>>
|
||||
dtls_writable_state_list_;
|
||||
std::vector<std::unique_ptr<RtcEventProbeClusterCreated>>
|
||||
probe_creation_list_;
|
||||
std::vector<std::unique_ptr<RtcEventProbeResultSuccess>> probe_success_list_;
|
||||
@ -406,6 +410,15 @@ void RtcEventLogSession::WriteLog(EventCounts count,
|
||||
}
|
||||
selection -= count.dtls_transport_states;
|
||||
|
||||
if (selection < count.dtls_writable_states) {
|
||||
auto event = gen_.NewDtlsWritableState();
|
||||
event_log->Log(event->Copy());
|
||||
dtls_writable_state_list_.push_back(std::move(event));
|
||||
count.dtls_writable_states--;
|
||||
continue;
|
||||
}
|
||||
selection -= count.dtls_writable_states;
|
||||
|
||||
if (selection < count.ice_configs) {
|
||||
auto event = gen_.NewIceCandidatePairConfig();
|
||||
event_log->Log(event->Copy());
|
||||
@ -661,6 +674,7 @@ TEST_P(RtcEventLogSession, StartLoggingFromBeginning) {
|
||||
count.bwe_loss_events = 20;
|
||||
count.bwe_delay_events = 20;
|
||||
count.dtls_transport_states = 4;
|
||||
count.dtls_writable_states = 2;
|
||||
count.probe_creations = 4;
|
||||
count.probe_successes = 2;
|
||||
count.probe_failures = 2;
|
||||
@ -687,6 +701,7 @@ TEST_P(RtcEventLogSession, StartLoggingInTheMiddle) {
|
||||
count.bwe_loss_events = 50;
|
||||
count.bwe_delay_events = 50;
|
||||
count.dtls_transport_states = 4;
|
||||
count.dtls_writable_states = 5;
|
||||
count.probe_creations = 10;
|
||||
count.probe_successes = 5;
|
||||
count.probe_failures = 5;
|
||||
|
||||
Reference in New Issue
Block a user