Add UMA for tracking which BWE versions are in use.
NOTRY=true BUG=webrtc:6156 Review-Url: https://codereview.webrtc.org/2206583002 Cr-Commit-Position: refs/heads/master@{#13619}
This commit is contained in:
@ -21,6 +21,7 @@
|
|||||||
#include "webrtc/modules/pacing/paced_sender.h"
|
#include "webrtc/modules/pacing/paced_sender.h"
|
||||||
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
||||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||||
|
#include "webrtc/system_wrappers/include/metrics.h"
|
||||||
#include "webrtc/typedefs.h"
|
#include "webrtc/typedefs.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -78,7 +79,7 @@ DelayBasedBwe::DelayBasedBwe(RemoteBitrateObserver* observer, Clock* clock)
|
|||||||
total_probes_received_(0),
|
total_probes_received_(0),
|
||||||
first_packet_time_ms_(-1),
|
first_packet_time_ms_(-1),
|
||||||
last_update_ms_(-1),
|
last_update_ms_(-1),
|
||||||
ssrcs_() {
|
uma_recorded_(false) {
|
||||||
RTC_DCHECK(observer_);
|
RTC_DCHECK(observer_);
|
||||||
// NOTE! The BitrateEstimatorTest relies on this EXACT log line.
|
// NOTE! The BitrateEstimatorTest relies on this EXACT log line.
|
||||||
LOG(LS_INFO) << "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
|
LOG(LS_INFO) << "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
|
||||||
@ -196,6 +197,12 @@ bool DelayBasedBwe::IsBitrateImproving(int new_bitrate_bps) const {
|
|||||||
void DelayBasedBwe::IncomingPacketFeedbackVector(
|
void DelayBasedBwe::IncomingPacketFeedbackVector(
|
||||||
const std::vector<PacketInfo>& packet_feedback_vector) {
|
const std::vector<PacketInfo>& packet_feedback_vector) {
|
||||||
RTC_DCHECK(network_thread_.CalledOnValidThread());
|
RTC_DCHECK(network_thread_.CalledOnValidThread());
|
||||||
|
if (!uma_recorded_) {
|
||||||
|
RTC_LOGGED_HISTOGRAM_ENUMERATION(kBweTypeHistogram,
|
||||||
|
BweNames::kSendSideTransportSeqNum,
|
||||||
|
BweNames::kBweNamesMax);
|
||||||
|
uma_recorded_ = true;
|
||||||
|
}
|
||||||
for (const auto& packet_info : packet_feedback_vector) {
|
for (const auto& packet_info : packet_feedback_vector) {
|
||||||
IncomingPacketInfo(packet_info.arrival_time_ms,
|
IncomingPacketInfo(packet_info.arrival_time_ms,
|
||||||
ConvertMsTo24Bits(packet_info.send_time_ms),
|
ConvertMsTo24Bits(packet_info.send_time_ms),
|
||||||
|
|||||||
@ -133,6 +133,7 @@ class DelayBasedBwe : public RemoteBitrateEstimator {
|
|||||||
size_t total_probes_received_;
|
size_t total_probes_received_;
|
||||||
int64_t first_packet_time_ms_;
|
int64_t first_packet_time_ms_;
|
||||||
int64_t last_update_ms_;
|
int64_t last_update_ms_;
|
||||||
|
bool uma_recorded_;
|
||||||
|
|
||||||
rtc::CriticalSection crit_;
|
rtc::CriticalSection crit_;
|
||||||
Ssrcs ssrcs_ GUARDED_BY(&crit_);
|
Ssrcs ssrcs_ GUARDED_BY(&crit_);
|
||||||
|
|||||||
@ -18,6 +18,7 @@ source_set("remote_bitrate_estimator") {
|
|||||||
sources = [
|
sources = [
|
||||||
"aimd_rate_control.cc",
|
"aimd_rate_control.cc",
|
||||||
"aimd_rate_control.h",
|
"aimd_rate_control.h",
|
||||||
|
"bwe_defines.cc",
|
||||||
"include/bwe_defines.h",
|
"include/bwe_defines.h",
|
||||||
"include/remote_bitrate_estimator.h",
|
"include/remote_bitrate_estimator.h",
|
||||||
"include/send_time_history.h",
|
"include/send_time_history.h",
|
||||||
|
|||||||
13
webrtc/modules/remote_bitrate_estimator/bwe_defines.cc
Normal file
13
webrtc/modules/remote_bitrate_estimator/bwe_defines.cc
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
const char* kBweTypeHistogram = "WebRTC.BWE.Types";
|
||||||
|
} // namespace webrtc
|
||||||
@ -21,6 +21,16 @@ namespace webrtc {
|
|||||||
|
|
||||||
static const int64_t kBitrateWindowMs = 1000;
|
static const int64_t kBitrateWindowMs = 1000;
|
||||||
|
|
||||||
|
extern const char* kBweTypeHistogram;
|
||||||
|
|
||||||
|
enum BweNames {
|
||||||
|
kReceiverNoExtension = 0,
|
||||||
|
kReceiverTOffset = 1,
|
||||||
|
kReceiverAbsSendTime = 2,
|
||||||
|
kSendSideTransportSeqNum = 3,
|
||||||
|
kBweNamesMax = 4
|
||||||
|
};
|
||||||
|
|
||||||
enum BandwidthUsage {
|
enum BandwidthUsage {
|
||||||
kBwNormal = 0,
|
kBwNormal = 0,
|
||||||
kBwUnderusing = 1,
|
kBwUnderusing = 1,
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
'include/send_time_history.h',
|
'include/send_time_history.h',
|
||||||
'aimd_rate_control.cc',
|
'aimd_rate_control.cc',
|
||||||
'aimd_rate_control.h',
|
'aimd_rate_control.h',
|
||||||
|
'bwe_defines.cc',
|
||||||
'inter_arrival.cc',
|
'inter_arrival.cc',
|
||||||
'inter_arrival.h',
|
'inter_arrival.h',
|
||||||
'overuse_detector.cc',
|
'overuse_detector.cc',
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
#include "webrtc/modules/pacing/paced_sender.h"
|
#include "webrtc/modules/pacing/paced_sender.h"
|
||||||
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
||||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||||
|
#include "webrtc/system_wrappers/include/metrics.h"
|
||||||
#include "webrtc/typedefs.h"
|
#include "webrtc/typedefs.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
@ -91,7 +92,7 @@ bool RemoteBitrateEstimatorAbsSendTime::IsWithinClusterBounds(
|
|||||||
total_probes_received_(0),
|
total_probes_received_(0),
|
||||||
first_packet_time_ms_(-1),
|
first_packet_time_ms_(-1),
|
||||||
last_update_ms_(-1),
|
last_update_ms_(-1),
|
||||||
ssrcs_() {
|
uma_recorded_(false) {
|
||||||
RTC_DCHECK(observer_);
|
RTC_DCHECK(observer_);
|
||||||
LOG(LS_INFO) << "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
|
LOG(LS_INFO) << "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
|
||||||
network_thread_.DetachFromThread();
|
network_thread_.DetachFromThread();
|
||||||
@ -237,6 +238,12 @@ void RemoteBitrateEstimatorAbsSendTime::IncomingPacketInfo(
|
|||||||
size_t payload_size,
|
size_t payload_size,
|
||||||
uint32_t ssrc) {
|
uint32_t ssrc) {
|
||||||
RTC_CHECK(send_time_24bits < (1ul << 24));
|
RTC_CHECK(send_time_24bits < (1ul << 24));
|
||||||
|
if (!uma_recorded_) {
|
||||||
|
RTC_LOGGED_HISTOGRAM_ENUMERATION(kBweTypeHistogram,
|
||||||
|
BweNames::kReceiverAbsSendTime,
|
||||||
|
BweNames::kBweNamesMax);
|
||||||
|
uma_recorded_ = true;
|
||||||
|
}
|
||||||
// Shift up send time to use the full 32 bits that inter_arrival works with,
|
// Shift up send time to use the full 32 bits that inter_arrival works with,
|
||||||
// so wrapping works properly.
|
// so wrapping works properly.
|
||||||
uint32_t timestamp = send_time_24bits << kAbsSendTimeInterArrivalUpshift;
|
uint32_t timestamp = send_time_24bits << kAbsSendTimeInterArrivalUpshift;
|
||||||
|
|||||||
@ -131,6 +131,7 @@ class RemoteBitrateEstimatorAbsSendTime : public RemoteBitrateEstimator {
|
|||||||
size_t total_probes_received_;
|
size_t total_probes_received_;
|
||||||
int64_t first_packet_time_ms_;
|
int64_t first_packet_time_ms_;
|
||||||
int64_t last_update_ms_;
|
int64_t last_update_ms_;
|
||||||
|
bool uma_recorded_;
|
||||||
|
|
||||||
rtc::CriticalSection crit_;
|
rtc::CriticalSection crit_;
|
||||||
Ssrcs ssrcs_ GUARDED_BY(&crit_);
|
Ssrcs ssrcs_ GUARDED_BY(&crit_);
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
#include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h"
|
#include "webrtc/modules/remote_bitrate_estimator/overuse_estimator.h"
|
||||||
#include "webrtc/system_wrappers/include/clock.h"
|
#include "webrtc/system_wrappers/include/clock.h"
|
||||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||||
|
#include "webrtc/system_wrappers/include/metrics.h"
|
||||||
#include "webrtc/typedefs.h"
|
#include "webrtc/typedefs.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
@ -54,7 +55,8 @@ RemoteBitrateEstimatorSingleStream::RemoteBitrateEstimatorSingleStream(
|
|||||||
observer_(observer),
|
observer_(observer),
|
||||||
crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
|
crit_sect_(CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
last_process_time_(-1),
|
last_process_time_(-1),
|
||||||
process_interval_ms_(kProcessIntervalMs) {
|
process_interval_ms_(kProcessIntervalMs),
|
||||||
|
uma_recorded_(false) {
|
||||||
assert(observer_);
|
assert(observer_);
|
||||||
LOG(LS_INFO) << "RemoteBitrateEstimatorSingleStream: Instantiating.";
|
LOG(LS_INFO) << "RemoteBitrateEstimatorSingleStream: Instantiating.";
|
||||||
}
|
}
|
||||||
@ -71,6 +73,14 @@ void RemoteBitrateEstimatorSingleStream::IncomingPacket(
|
|||||||
int64_t arrival_time_ms,
|
int64_t arrival_time_ms,
|
||||||
size_t payload_size,
|
size_t payload_size,
|
||||||
const RTPHeader& header) {
|
const RTPHeader& header) {
|
||||||
|
if (!uma_recorded_) {
|
||||||
|
BweNames type = BweNames::kReceiverTOffset;
|
||||||
|
if (!header.extension.hasTransmissionTimeOffset)
|
||||||
|
type = BweNames::kReceiverNoExtension;
|
||||||
|
RTC_LOGGED_HISTOGRAM_ENUMERATION(
|
||||||
|
kBweTypeHistogram, type, BweNames::kBweNamesMax);
|
||||||
|
uma_recorded_ = true;
|
||||||
|
}
|
||||||
uint32_t ssrc = header.ssrc;
|
uint32_t ssrc = header.ssrc;
|
||||||
uint32_t rtp_timestamp = header.timestamp +
|
uint32_t rtp_timestamp = header.timestamp +
|
||||||
header.extension.transmissionTimeOffset;
|
header.extension.transmissionTimeOffset;
|
||||||
|
|||||||
@ -61,6 +61,7 @@ class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator {
|
|||||||
std::unique_ptr<CriticalSectionWrapper> crit_sect_;
|
std::unique_ptr<CriticalSectionWrapper> crit_sect_;
|
||||||
int64_t last_process_time_;
|
int64_t last_process_time_;
|
||||||
int64_t process_interval_ms_ GUARDED_BY(crit_sect_.get());
|
int64_t process_interval_ms_ GUARDED_BY(crit_sect_.get());
|
||||||
|
bool uma_recorded_;
|
||||||
|
|
||||||
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteBitrateEstimatorSingleStream);
|
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteBitrateEstimatorSingleStream);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include "webrtc/base/checks.h"
|
#include "webrtc/base/checks.h"
|
||||||
#include "webrtc/base/logging.h"
|
#include "webrtc/base/logging.h"
|
||||||
#include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h"
|
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
|
||||||
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
|
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
|
||||||
#include "webrtc/modules/utility/include/process_thread.h"
|
#include "webrtc/modules/utility/include/process_thread.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user