Commit a4f07049 authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Add Incognito profile lifetime duration metrics.

UMA stats collection is added for the life time of incognito profile.

Bug: 966747
Change-Id: Ic83f3f88589e9fb6088f140575b38cc1c0798bf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628747
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Auto-Submit: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664753}
parent 0ab5d97d
......@@ -11,6 +11,7 @@
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/post_task.h"
......@@ -242,6 +243,14 @@ OffTheRecordProfileImpl::~OffTheRecordProfileImpl() {
// This must be called before ProfileIOData::ShutdownOnUIThread but after
// other profile-related destroy notifications are dispatched.
ShutdownStoragePartitions();
// Store incognito lifetime histogram.
if (!IsGuestSession()) {
auto duration = base::Time::Now() - start_time_;
base::UmaHistogramCustomCounts(
"Profile.Incognito.Lifetime", duration.InMinutes(), 1,
base::TimeDelta::FromDays(28).InMinutes(), 100);
}
}
void OffTheRecordProfileImpl::InitIoData() {
......
......@@ -100916,6 +100916,16 @@ uploading your change for review.
<summary>Size of the history database.</summary>
</histogram>
<histogram name="Profile.Incognito.Lifetime" units="minutes"
expires_after="M80">
<owner>rhalavati@chromium.org</owner>
<owner>msramek@chromium.org</owner>
<summary>
This histogram records the lifetime duration of incognito profiles. It is
recorded once an off the record profile for an incognito session is closed.
</summary>
</histogram>
<histogram name="Profile.InitProfileUserPrefs.OutsideUserDir" enum="BooleanHit"
expires_after="M77">
<owner>anthonyvd@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