Commit f5a1228c authored by Regan Hsu's avatar Regan Hsu Committed by Chromium LUCI CQ

[CrOS PhoneHub] Change PhoneHub.Connectivity.Duration upper bound

Fixed: 1164582
Bug: 1106937
Change-Id: Iac5a7f61cd0f3b3354c4e9281342b07edb18b26b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627145Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843293}
parent d780342d
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "chromeos/components/phonehub/connection_manager_impl.h" #include "chromeos/components/phonehub/connection_manager_impl.h"
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chromeos/constants/chromeos_features.h" #include "chromeos/constants/chromeos_features.h"
...@@ -52,7 +53,7 @@ void ConnectionManagerImpl::MetricsRecorder::OnConnectionStatusChanged() { ...@@ -52,7 +53,7 @@ void ConnectionManagerImpl::MetricsRecorder::OnConnectionStatusChanged() {
case ConnectionManager::Status::kDisconnected: case ConnectionManager::Status::kDisconnected:
if (prev_status == ConnectionManager::Status::kConnected) { if (prev_status == ConnectionManager::Status::kConnected) {
UMA_HISTOGRAM_TIMES("PhoneHub.Connectivity.Duration", delta); base::UmaHistogramLongTimes100("PhoneHub.Connection.Duration", delta);
} else if (prev_status == ConnectionManager::Status::kConnecting) { } else if (prev_status == ConnectionManager::Status::kConnecting) {
RecordConnectionSuccessMetric(false); RecordConnectionSuccessMetric(false);
} }
......
...@@ -240,7 +240,7 @@ TEST_F(ConnectionManagerImplTest, SuccessfulAttemptConnectionButDisconnected) { ...@@ -240,7 +240,7 @@ TEST_F(ConnectionManagerImplTest, SuccessfulAttemptConnectionButDisconnected) {
EXPECT_EQ(3u, GetNumStatusObserverCalls()); EXPECT_EQ(3u, GetNumStatusObserverCalls());
EXPECT_EQ(ConnectionManager::Status::kDisconnected, GetStatus()); EXPECT_EQ(ConnectionManager::Status::kDisconnected, GetStatus());
histogram_tester_.ExpectTimeBucketCount("PhoneHub.Connectivity.Duration", histogram_tester_.ExpectTimeBucketCount("PhoneHub.Connection.Duration",
kFakeConnectionDurationTime, 1); kFakeConnectionDurationTime, 1);
} }
......
...@@ -51,6 +51,15 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -51,6 +51,15 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="PhoneHub.Connection.Duration" units="ms" expires_after="M99">
<owner>khorimoto@chromium.org</owner>
<owner>better-together-dev@google.com</owner>
<summary>
The duration of time the phone is in the connected state, and becomes
disconnected.
</summary>
</histogram>
<histogram name="PhoneHub.Connection.Result" enum="BooleanSuccess" <histogram name="PhoneHub.Connection.Result" enum="BooleanSuccess"
expires_after="2021-11-30"> expires_after="2021-11-30">
<owner>khorimoto@chromium.org</owner> <owner>khorimoto@chromium.org</owner>
...@@ -62,6 +71,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -62,6 +71,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</histogram> </histogram>
<histogram name="PhoneHub.Connectivity.Duration" units="ms" expires_after="M98"> <histogram name="PhoneHub.Connectivity.Duration" units="ms" expires_after="M98">
<obsolete>
Renamed to PhoneHub.Connection.Duration on 1/2021 in M89.
</obsolete>
<owner>khorimoto@chromium.org</owner> <owner>khorimoto@chromium.org</owner>
<owner>better-together-dev@google.com</owner> <owner>better-together-dev@google.com</owner>
<summary> <summary>
......
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