Commit e7192d4d authored by Meilin Wang's avatar Meilin Wang Committed by Chromium LUCI CQ

[CrOS PhoneHub] Add metrics for tether connection result.

Bug: 1150634
Change-Id: I84ad38c9eb8af368c0c34ba56305da0088d121ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2568364
Commit-Queue: Meilin Wang <meilinw@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833883}
parent 3b8b7c35
......@@ -6,6 +6,7 @@
#include "chromeos/components/multidevice/logging/logging.h"
#include "chromeos/components/phonehub/phone_status_model.h"
#include "chromeos/components/phonehub/util/histogram_util.h"
#include "chromeos/services/network_config/in_process_instance.h"
namespace chromeos {
......@@ -113,6 +114,8 @@ void TetherControllerImpl::AttemptConnection() {
}
PA_LOG(INFO) << "Attempting connection; current status is " << status_;
util::LogTetherConnectionResult(
util::TetherConnectionResult::kAttemptConnection);
FeatureState feature_state =
multidevice_setup_client_->GetFeatureState(Feature::kInstantTethering);
......@@ -383,6 +386,11 @@ void TetherControllerImpl::UpdateStatus() {
PA_LOG(INFO) << "TetherController status update: " << status_ << " => "
<< status;
// Log the connection attempt result if it has succeed.
if (status == Status::kConnected)
util::LogTetherConnectionResult(util::TetherConnectionResult::kSuccess);
status_ = status;
NotifyStatusChanged();
......
......@@ -4,14 +4,19 @@
#include "chromeos/components/phonehub/util/histogram_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/histogram_functions.h"
namespace chromeos {
namespace phonehub {
namespace util {
void LogFeatureOptInEntryPoint(OptInEntryPoint entry_point) {
UMA_HISTOGRAM_ENUMERATION("PhoneHub.OptInEntryPoint", entry_point);
base::UmaHistogramEnumeration("PhoneHub.OptInEntryPoint", entry_point);
}
void LogTetherConnectionResult(TetherConnectionResult result) {
base::UmaHistogramEnumeration(
"PhoneHub.TaskCompletion.TetherConnection.Result", result);
}
} // namespace util
......
......@@ -20,9 +20,19 @@ enum class OptInEntryPoint {
kMaxValue = kSettings,
};
// Enumeration of results of a tethering connection attempt.
enum class TetherConnectionResult {
kAttemptConnection = 0,
kSuccess = 1,
kMaxValue = kSuccess,
};
// Logs a given opt-in |entry_point| for the PhoneHub feature.
void LogFeatureOptInEntryPoint(OptInEntryPoint entry_point);
// Logs a given |result| of a tethering connection attempt.
void LogTetherConnectionResult(TetherConnectionResult result);
} // namespace util
} // namespace phonehub
} // namespace chromeos
......
......@@ -58304,6 +58304,11 @@ Called by update_net_trust_anchors.py.-->
<int value="9" label="PhoneConnecting"/>
</enum>
<enum name="PhoneHubTetherConnectionResult">
<int value="0" label="Started a tether connection attempt"/>
<int value="1" label="Attempt was successful"/>
</enum>
<enum name="PhoneNumberRegexVariantResult">
<obsolete>
Removed in M82 as the experiment has been stopped.
......@@ -171,6 +171,16 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="PhoneHub.TaskCompletion.TetherConnection.Result"
enum="PhoneHubTetherConnectionResult" expires_after="2021-12-01">
<owner>khorimoto@chromium.org</owner>
<owner>phonehub-dev@google.com</owner>
<summary>
Logs the result of attempting a tether connection to measure the connection
success rate.
</summary>
</histogram>
<histogram name="PhoneHub.Usage.SentMessageTypeCount"
enum="PhoneHubMessageType" expires_after="M98">
<owner>khorimoto@chromium.org</owner>
......
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