Commit e2419cdd authored by rtenneti@chromium.org's avatar rtenneti@chromium.org

QUIC - Track the reason for sending InchoateClientHello in UMA

histogram.

Possible reasons are: no/empty server config, expired server config,
invalid server config and corrupted server config.

R=rch@chromium.org, asvitkine@chromium.org

Review URL: https://codereview.chromium.org/416983005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285765 0039d316-1c4b-4281-b951-d872f2087c98
parent 0d0a6870
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "net/quic/crypto/quic_crypto_client_config.h" #include "net/quic/crypto/quic_crypto_client_config.h"
#include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h" #include "base/metrics/sparse_histogram.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
...@@ -29,6 +30,30 @@ using std::vector; ...@@ -29,6 +30,30 @@ using std::vector;
namespace net { namespace net {
namespace {
enum ServerConfigState {
// WARNING: Do not change the numerical values of any of server config state.
// Do not remove deprecated server config states - just comment them as
// deprecated.
SERVER_CONFIG_EMPTY = 0,
SERVER_CONFIG_INVALID = 1,
SERVER_CONFIG_CORRUPTED = 2,
SERVER_CONFIG_EXPIRED = 3,
// NOTE: Add new server config states only immediately above this line. Make
// sure to update the QuicServerConfigState enum in
// tools/metrics/histograms/histograms.xml accordingly.
SERVER_CONFIG_COUNT
};
void RecordServerConfigState(ServerConfigState server_config_state) {
UMA_HISTOGRAM_ENUMERATION("Net.QuicClientHelloServerConfigState",
server_config_state, SERVER_CONFIG_COUNT);
}
} // namespace
QuicCryptoClientConfig::QuicCryptoClientConfig() QuicCryptoClientConfig::QuicCryptoClientConfig()
: disable_ecdsa_(false) {} : disable_ecdsa_(false) {}
...@@ -43,7 +68,13 @@ QuicCryptoClientConfig::CachedState::CachedState() ...@@ -43,7 +68,13 @@ QuicCryptoClientConfig::CachedState::CachedState()
QuicCryptoClientConfig::CachedState::~CachedState() {} QuicCryptoClientConfig::CachedState::~CachedState() {}
bool QuicCryptoClientConfig::CachedState::IsComplete(QuicWallTime now) const { bool QuicCryptoClientConfig::CachedState::IsComplete(QuicWallTime now) const {
if (server_config_.empty() || !server_config_valid_) { if (server_config_.empty()) {
RecordServerConfigState(SERVER_CONFIG_EMPTY);
return false;
}
if (!server_config_valid_) {
RecordServerConfigState(SERVER_CONFIG_INVALID);
return false; return false;
} }
...@@ -51,12 +82,14 @@ bool QuicCryptoClientConfig::CachedState::IsComplete(QuicWallTime now) const { ...@@ -51,12 +82,14 @@ bool QuicCryptoClientConfig::CachedState::IsComplete(QuicWallTime now) const {
if (!scfg) { if (!scfg) {
// Should be impossible short of cache corruption. // Should be impossible short of cache corruption.
DCHECK(false); DCHECK(false);
RecordServerConfigState(SERVER_CONFIG_CORRUPTED);
return false; return false;
} }
uint64 expiry_seconds; uint64 expiry_seconds;
if (scfg->GetUint64(kEXPY, &expiry_seconds) != QUIC_NO_ERROR || if (scfg->GetUint64(kEXPY, &expiry_seconds) != QUIC_NO_ERROR ||
now.ToUNIXSeconds() >= expiry_seconds) { now.ToUNIXSeconds() >= expiry_seconds) {
RecordServerConfigState(SERVER_CONFIG_EXPIRED);
return false; return false;
} }
......
...@@ -14964,6 +14964,15 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -14964,6 +14964,15 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary> </summary>
</histogram> </histogram>
<histogram name="Net.QuicClientHelloServerConfigState"
enum="QuicServerConfigState">
<owner>rtenneti@chromium.org</owner>
<summary>
The reason (the state of the server config) for sending InchoateClientHello
to the server.
</summary>
</histogram>
<histogram name="Net.QuicEphemeralPortsSuggested"> <histogram name="Net.QuicEphemeralPortsSuggested">
<owner>rch@chromium.org</owner> <owner>rch@chromium.org</owner>
<summary>The number of ports suggested per server.</summary> <summary>The number of ports suggested per server.</summary>
...@@ -45974,6 +45983,13 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -45974,6 +45983,13 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="6" label="CANCELLED"/> <int value="6" label="CANCELLED"/>
</enum> </enum>
<enum name="QuicServerConfigState" type="int">
<int value="0" label="SERVER_CONFIG_EMPTY"/>
<int value="1" label="SERVER_CONFIG_INVALID"/>
<int value="2" label="SERVER_CONFIG_CORRUPTED"/>
<int value="3" label="SERVER_CONFIG_EXPIRED"/>
</enum>
<enum name="QuicSessionErrorCodes" type="int"> <enum name="QuicSessionErrorCodes" type="int">
<int value="0" label="CONNECTING_SOCKET"/> <int value="0" label="CONNECTING_SOCKET"/>
<int value="1" label="SETTING_RECEIVE_BUFFER"/> <int value="1" label="SETTING_RECEIVE_BUFFER"/>
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