Bug 1491511: add Telemetry for SRTP cipher usage. r=mt

Bug 1491511: add Telemetry for SRTP cipher usage. r=mt

Differential Revision: https://phabricator.services.mozilla.com/D5956

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nils Ohlmeier [:drno] 2018-09-19 00:08:25 +00:00
Родитель 4aab8cafdd
Коммит 5d1ae0414f
2 изменённых файлов: 38 добавлений и 1 удалений

Просмотреть файл

@ -1528,7 +1528,7 @@ TransportLayerDtls::RecordCipherTelemetry() {
nsresult rv = GetCipherSuite(&cipher);
if (NS_FAILED(rv)) {
MOZ_MTLOG(ML_ERROR, "Failed to get cipher suite");
MOZ_MTLOG(ML_ERROR, "Failed to get DTLS cipher suite");
return;
}
@ -1580,6 +1580,34 @@ TransportLayerDtls::RecordCipherTelemetry() {
}
Telemetry::Accumulate(Telemetry::WEBRTC_DTLS_CIPHER, t_cipher);
rv = GetSrtpCipher(&cipher);
if (NS_FAILED(rv)) {
MOZ_MTLOG(ML_ERROR, "Failed to get SRTP cipher suite");
return;
}
mozilla::Telemetry::LABELS_WEBRTC_SRTP_CIPHER label =
mozilla::Telemetry::LABELS_WEBRTC_SRTP_CIPHER::Unknown;
switch (cipher) {
case kDtlsSrtpAes128CmHmacSha1_80:
label = Telemetry::LABELS_WEBRTC_SRTP_CIPHER::Aes128CmHmacSha1_80;
break;
case kDtlsSrtpAes128CmHmacSha1_32:
label = Telemetry::LABELS_WEBRTC_SRTP_CIPHER::Aes128CmHmacSha1_32;
break;
case kDtlsSrtpAeadAes128Gcm:
label = Telemetry::LABELS_WEBRTC_SRTP_CIPHER::AeadAes128Gcm;
break;
case kDtlsSrtpAeadAes256Gcm:
label = Telemetry::LABELS_WEBRTC_SRTP_CIPHER::AeadAes256Gcm;
break;
}
Telemetry::AccumulateCategorical(label);
}
} // close namespace

Просмотреть файл

@ -8673,6 +8673,15 @@
"n_values": 14,
"description": "The DTLS cipher (as integer) negotiated for a RTCPeerConnection. See TransportLayerDtls::RecordCipherTelemetry for the meaning of the values"
},
"WEBRTC_SRTP_CIPHER": {
"record_in_processes": ["content"],
"alert_emails": ["webrtc-dtls-telemetry-alerts@mozilla.com", "nohlmeier@mozilla.com"],
"bug_numbers": [1491511],
"expires_in_version": "67",
"kind": "categorical",
"labels": ["Unknown", "Aes128CmHmacSha1_80", "Aes128CmHmacSha1_32", "AeadAes128Gcm", "AeadAes256Gcm"],
"description": "The SRTP cipher (as integer) negotiated for a RTCPeerConnection. See TransportLayerDtls::RecordCipherTelemetry for the meaning of the values"
},
"WEBRTC_ICE_FINAL_CONNECTION_STATE": {
"record_in_processes": ["main", "content"],
"alert_emails": ["webrtc-ice-telemetry-alerts@mozilla.com, nohlmeier@mozilla.com"],