Commit 184856ec authored by Clemens Arbesser's avatar Clemens Arbesser Committed by Commit Bot

[Autofill Assistant] Ensure that UMA dropout is recorded only once.

The UMA histogram AutofillAssistant.DropOutReason is currently showing incorrect data, because the number of autobot drop-outs adds up to more than the number of autobot starts. This likely happens because the shutdown procedure for autobot is different between closing autobot from the user interface versus closing Chrome entirely. As a consequence, dropout reasons are logged in two different places in code. We might be able to refactor such that we can avoid this in the future.

For now and as a hotfix, this CL ensures that every instance of autobot can record at most one dropout reason.

Bug: b/140371674
Change-Id: I17b882e1327be6228867321b4ba6536b45a6822f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1780834Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Commit-Queue: Clemens Arbesser <arbesser@google.com>
Cr-Commit-Position: refs/heads/master@{#696751}
parent f9c34652
......@@ -14,14 +14,19 @@ const char kPaymentRequestPrefilledName[] =
"Android.AutofillAssistant.PaymentRequest.Prefilled";
const char kPaymentRequestAutofillInfoChangedName[] =
"Android.AutofillAssistant.PaymentRequest.AutofillChanged";
static bool DROPOUT_RECORDED = false;
} // namespace
// static
void Metrics::RecordDropOut(DropOutReason reason) {
DCHECK_LE(reason, DropOutReason::kMaxValue);
if (DROPOUT_RECORDED) {
return;
}
DVLOG_IF(3, reason != DropOutReason::AA_START)
<< "Drop out with reason: " << reason;
base::UmaHistogramEnumeration(kDropOutEnumName, reason);
DROPOUT_RECORDED = true;
}
// static
......
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