| Index: talk/app/webrtc/webrtcsession.cc
|
| diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc
|
| index bd1cd1a0ac8589af2b76977748e3ce7e6af25308..6570d9e49edfc550a6306baefc1144df1a6f4ca8 100644
|
| --- a/talk/app/webrtc/webrtcsession.cc
|
| +++ b/talk/app/webrtc/webrtcsession.cc
|
| @@ -48,6 +48,7 @@
|
| #include "webrtc/base/checks.h"
|
| #include "webrtc/base/helpers.h"
|
| #include "webrtc/base/logging.h"
|
| +#include "webrtc/base/sslstrings.h"
|
| #include "webrtc/base/stringencode.h"
|
| #include "webrtc/base/stringutils.h"
|
| #include "webrtc/p2p/base/portallocator.h"
|
| @@ -90,6 +91,14 @@ const char kDtlsSetupFailureRtcp[] =
|
| const char kEnableBundleFailed[] = "Failed to enable BUNDLE.";
|
| const int kMaxUnsignalledRecvStreams = 20;
|
|
|
| +SrtpCipherType GetSrtpCipherType(const std::string& cipher) {
|
| + if (cipher == rtc::AES_CM_128_HMAC_SHA1_32_NAME)
|
| + return SrtpCipher_AES_CM_128_HMAC_SHA1_32;
|
| + if (cipher == rtc::AES_CM_128_HMAC_SHA1_80_NAME)
|
| + return SrtpCipher_AES_CM_128_HMAC_SHA1_80;
|
| + return SrtpCipher_Unknown;
|
| +}
|
| +
|
| IceCandidatePairType GetIceCandidatePairCounter(
|
| const cricket::Candidate& local,
|
| const cricket::Candidate& remote) {
|
| @@ -2141,32 +2150,35 @@ void WebRtcSession::ReportNegotiatedCiphers(
|
| }
|
|
|
| const std::string& srtp_cipher = stats.channel_stats[0].srtp_cipher;
|
| - const std::string& ssl_cipher = stats.channel_stats[0].ssl_cipher;
|
| - if (srtp_cipher.empty() && ssl_cipher.empty()) {
|
| + const rtc::SslCipher& ssl_cipher = stats.channel_stats[0].ssl_cipher;
|
| + if (srtp_cipher.empty() && ssl_cipher.name.empty()) {
|
| return;
|
| }
|
|
|
| - PeerConnectionMetricsName srtp_name;
|
| - PeerConnectionMetricsName ssl_name;
|
| + PeerConnectionEnumCounterType srtp_counter_type;
|
| + PeerConnectionEnumCounterType ssl_counter_type;
|
| if (stats.transport_name == cricket::CN_AUDIO) {
|
| - srtp_name = kAudioSrtpCipher;
|
| - ssl_name = kAudioSslCipher;
|
| + srtp_counter_type = kEnumCounterAudioSrtpCipher;
|
| + ssl_counter_type = kEnumCounterAudioSslCipher;
|
| } else if (stats.transport_name == cricket::CN_VIDEO) {
|
| - srtp_name = kVideoSrtpCipher;
|
| - ssl_name = kVideoSslCipher;
|
| + srtp_counter_type = kEnumCounterVideoSrtpCipher;
|
| + ssl_counter_type = kEnumCounterVideoSslCipher;
|
| } else if (stats.transport_name == cricket::CN_DATA) {
|
| - srtp_name = kDataSrtpCipher;
|
| - ssl_name = kDataSslCipher;
|
| + srtp_counter_type = kEnumCounterDataSrtpCipher;
|
| + ssl_counter_type = kEnumCounterDataSslCipher;
|
| } else {
|
| RTC_NOTREACHED();
|
| return;
|
| }
|
|
|
| if (!srtp_cipher.empty()) {
|
| - metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher);
|
| + metrics_observer_->IncrementEnumCounter(
|
| + srtp_counter_type, GetSrtpCipherType(srtp_cipher), SrtpCipher_Max);
|
| }
|
| - if (!ssl_cipher.empty()) {
|
| - metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher);
|
| + if (!ssl_cipher.name.empty()) {
|
| + RTC_DCHECK(ssl_cipher.ssl_id);
|
| + metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type,
|
| + ssl_cipher.ssl_id);
|
| }
|
| }
|
|
|
|
|