Commit 01aafe52 authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS CryptAuth] Source metrics for CryptAuth.Enrollment.Result at another location.

Metric collection was missing in OnFinishEnrollmentFailure.

Bug: 870138
Change-Id: Ia10d63753f7732257b1e7195d117fa4725ba1542
Reviewed-on: https://chromium-review.googlesource.com/c/1313754Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604778}
parent f8a9f2a5
......@@ -52,6 +52,10 @@ std::string CreateEnrollmentPublicMetadata() {
return metadata.SerializeAsString();
}
void RecordEnrollmentResult(bool success) {
UMA_HISTOGRAM_BOOLEAN("CryptAuth.Enrollment.Result", success);
}
} // namespace
CryptAuthEnrollerImpl::CryptAuthEnrollerImpl(
......@@ -220,13 +224,14 @@ void CryptAuthEnrollerImpl::OnFinishEnrollmentSuccess(
<< response.status();
}
UMA_HISTOGRAM_BOOLEAN("CryptAuth.Enrollment.Result", success);
RecordEnrollmentResult(success);
callback_.Run(success);
}
void CryptAuthEnrollerImpl::OnFinishEnrollmentFailure(
NetworkRequestError error) {
PA_LOG(WARNING) << "FinishEnrollment API failed with error: " << error;
RecordEnrollmentResult(false /* success */);
callback_.Run(false);
}
......
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