Commit de0fd548 authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

Add UMA logging of WebRTC usage patterns.

This adds (as a drive-by) logging when unknown values are
used in UMA-from-webrtc, since this indicates an incomplete change.

Bug: chromium:718508
Change-Id: Ic21551e677a58f34d8e2418c17d1bf3256928cdb
Reviewed-on: https://chromium-review.googlesource.com/1082476Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566403}
parent c745083a
......@@ -685,7 +685,13 @@ class PeerConnectionUMAObserver : public webrtc::UMAObserver {
break;
default:
// The default clause is expected to be reached when new enum types are
// added.
// added. Log, but only once.
{
static bool log_once = false;
LOG_IF(ERROR, !log_once) << "New WebRTC enum counter found: "
<< static_cast<int>(counter_type);
log_once = true;
}
break;
}
}
......@@ -726,9 +732,18 @@ class PeerConnectionUMAObserver : public webrtc::UMAObserver {
base::UmaHistogramSparse("WebRTC.PeerConnection.SrtcpUnprotectError",
counter);
break;
case webrtc::kEnumCounterUsagePattern:
base::UmaHistogramSparse("WebRTC.PeerConnection.UsagePattern", counter);
break;
default:
// The default clause is expected to reach when new enum types are
// added.
// The default clause is expected to be reached when new enum types are
// added. Log, but only once.
{
static bool log_once = false;
LOG_IF(ERROR, !log_once) << "New WebRTC sparse enum counter found: "
<< static_cast<int>(counter_type);
log_once = true;
}
break;
}
}
......@@ -751,8 +766,14 @@ class PeerConnectionUMAObserver : public webrtc::UMAObserver {
value);
break;
default:
// The default clause is expected to reach when new enum types are
// added.
// The default clause is expected to be reached when new enum types are
// added. Log, but only once.
{
static bool log_once = false;
LOG_IF(ERROR, !log_once) << "New WebRTC histogram counter found: "
<< static_cast<int>(type);
log_once = true;
}
break;
}
}
......
......@@ -48318,6 +48318,16 @@ Full version information for the fingerprint enum values:
<int value="4" label="Other"/>
</enum>
<enum name="WebRtcPeerConnectionUsagePattern">
<summary>
These values are integers representing a set of flags indicating how the
PeerConnection is used. For flag values, see header file
webrtc/pc/peerconnection.h, enum class UsageEvent. Only interesting values
are called out with labels.
</summary>
<int value="0" label="Unused and unclosed"/>
</enum>
<enum name="WebRtcVideoCodecs">
<int value="0" label="Unknown"/>
<int value="1" label="VP8"/>
......@@ -109529,6 +109529,16 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="WebRTC.PeerConnection.UsagePattern"
enum="WebRtcPeerConnectionUsagePattern">
<owner>hta@chromium.org</owner>
<summary>
Capsule history of a WebRTC PeerConnection, encoded as a sequence of bits
encapsulated in an integer. Only a few values will be deemed interesting,
but the interesting values may change over time.
</summary>
</histogram>
<histogram name="WebRTC.ReceivedAudioTrackDuration" units="ms">
<owner>perkj@chromium.org</owner>
<summary>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment