Commit 9b0e694f authored by Kartik Hegde's avatar Kartik Hegde Committed by Commit Bot

cleanup: Clarify DnsLatency problem

Switch kFailedToResolveAllHosts to the clearer kHostResolutionFailure to
denote when one or more hosts failed DNS resolution.

BUG=chromium:956783
TEST=unit_tests --gtest_filter=DnsLatencyRoutineTest.*

Change-Id: I0392df692919a55896e439edc5f53801d756873d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490069Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Kartik Hegde <khegde@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819546}
parent b6deb469
...@@ -103,7 +103,7 @@ Problems: ...@@ -103,7 +103,7 @@ Problems:
Tests whether the DNS latency is below an acceptable threshold. Tests whether the DNS latency is below an acceptable threshold.
Problems: Problems:
* `kFailedToResolveAllHosts`: Failed to resolve one or more hosts. * `kHostResolutionFailure`: Failed to resolve one or more hosts.
* `kSlightlyAboveThreshold`: Average DNS latency across hosts is slightly above * `kSlightlyAboveThreshold`: Average DNS latency across hosts is slightly above
expected threshold. expected threshold.
* `kSignificantlyAboveThreshold`: Average DNS latency across hosts is * `kSignificantlyAboveThreshold`: Average DNS latency across hosts is
......
...@@ -108,7 +108,7 @@ void DnsLatencyRoutine::AnalyzeResultsAndExecuteCallback() { ...@@ -108,7 +108,7 @@ void DnsLatencyRoutine::AnalyzeResultsAndExecuteCallback() {
double average_latency = AverageLatency(latencies_); double average_latency = AverageLatency(latencies_);
if (!successfully_resolved_all_addresses_ || average_latency == 0.0) { if (!successfully_resolved_all_addresses_ || average_latency == 0.0) {
set_verdict(mojom::RoutineVerdict::kProblem); set_verdict(mojom::RoutineVerdict::kProblem);
problems_.emplace_back(mojom::DnsLatencyProblem::kFailedToResolveAllHosts); problems_.emplace_back(mojom::DnsLatencyProblem::kHostResolutionFailure);
} else if (average_latency > kBadLatencyMs.InMillisecondsF() && } else if (average_latency > kBadLatencyMs.InMillisecondsF() &&
average_latency <= kVeryBadLatencyMs.InMillisecondsF()) { average_latency <= kVeryBadLatencyMs.InMillisecondsF()) {
set_verdict(mojom::RoutineVerdict::kProblem); set_verdict(mojom::RoutineVerdict::kProblem);
......
...@@ -233,7 +233,7 @@ TEST_F(DnsLatencyRoutineTest, TestUnsuccessfulResolution) { ...@@ -233,7 +233,7 @@ TEST_F(DnsLatencyRoutineTest, TestUnsuccessfulResolution) {
// because a failed resolution attempt already results in a problem. // because a failed resolution attempt already results in a problem.
SetUpAndRunRoutine(fake_dns_result.get(), kSuccessfulDnsResolutionDelayMs, SetUpAndRunRoutine(fake_dns_result.get(), kSuccessfulDnsResolutionDelayMs,
mojom::RoutineVerdict::kProblem, mojom::RoutineVerdict::kProblem,
{mojom::DnsLatencyProblem::kFailedToResolveAllHosts}); {mojom::DnsLatencyProblem::kHostResolutionFailure});
} }
// This test case represents the scenario where a DNS resolution was successful; // This test case represents the scenario where a DNS resolution was successful;
......
...@@ -60,9 +60,8 @@ enum DnsResolverPresentProblem { ...@@ -60,9 +60,8 @@ enum DnsResolverPresentProblem {
// Problems related to the DnsLatencyProblem routine. // Problems related to the DnsLatencyProblem routine.
[Extensible] [Extensible]
enum DnsLatencyProblem { enum DnsLatencyProblem {
// The routine was unable to successfully resolve all the hosts. Note that // The routine was unable to resolve one or more hosts.
// this will be true if one or more hosts could not be successfully resolved. kHostResolutionFailure,
kFailedToResolveAllHosts,
// Average DNS latency across hosts is slightly above expected threshold // Average DNS latency across hosts is slightly above expected threshold
kSlightlyAboveThreshold, kSlightlyAboveThreshold,
// Average DNS latency across hosts is significantly above expected threshold // Average DNS latency across hosts is significantly above expected threshold
......
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