Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Unified Diff: net/socket/ssl_client_socket_pool.cc

Issue 1312363004: Add histogram for key exchange strength (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stricter on what is logged Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_pool.cc
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
index a80df57d0be4a8d084e62c5d09f1040ee458c962..b16eeedd2f8494a59a14600daafbc2e24b19bf04 100644
--- a/net/socket/ssl_client_socket_pool.cc
+++ b/net/socket/ssl_client_socket_pool.cc
@@ -21,6 +21,7 @@
#include "net/socket/ssl_client_socket.h"
#include "net/socket/transport_client_socket_pool.h"
#include "net/ssl/ssl_cert_request_info.h"
+#include "net/ssl/ssl_cipher_suite_names.h"
#include "net/ssl/ssl_connection_status_flags.h"
#include "net/ssl/ssl_info.h"
@@ -371,9 +372,28 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
ssl_info.connection_status),
SSL_CONNECTION_VERSION_MAX);
- UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_CipherSuite",
- SSLConnectionStatusToCipherSuite(
- ssl_info.connection_status));
+ uint16 cipher_suite =
+ SSLConnectionStatusToCipherSuite(ssl_info.connection_status);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_CipherSuite", cipher_suite);
+
+ const char *str, *cipher_str, *mac_str;
+ bool is_aead;
+ SSLCipherSuiteToStrings(&str, &cipher_str, &mac_str, &is_aead,
+ cipher_suite);
+ // UMA_HISTOGRAM_... macros cache the Histogram instance and thus only work
+ // if the histogram name is constant, so don't generate it dynamically.
+ if (strcmp(str, "RSA") == 0) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.RSA",
+ ssl_info.key_exchange_info);
+ } else if (strncmp(str, "DHE_", 4) == 0) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.DHE",
+ ssl_info.key_exchange_info);
+ } else if (strncmp(str, "ECDHE_", 6) == 0) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.ECDHE",
+ ssl_info.key_exchange_info);
+ } else {
+ NOTREACHED();
+ }
if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_RESUME) {
UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Resume_Handshake",
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698