Commit 779b60be authored by Eugene But's avatar Eugene But Committed by Chromium LUCI CQ

Record Stability.iOS.Experimental.Counts metric

Recorded when iOS app has started after a crash caused by system signal
or hang. Not recorded when app has started after UTE or XTE. See
go/bling-stability-101 for imformation about signal crashes, hangs, UTEs
and XTEs. This metric intends to compliment Stability.Counts.
Stability.Counts does include UTEs / XTEs and thus is a noisy metric
which significantly overcounts user-visible crashes.
Stability.IOS.Experimental.Counts is not recorded on OOM crashes, so it
does not represent all use-visible crashes, but OOMs are so rare in
Chrome for iOS that Stability.IOS.Experimental.Counts is still a good
proxy for user-visible crashes. IOS.MetricKit.ForegroundExitData
includes OOM crashes and can be used in conjunction with this metric.

Bug: 1166922
Change-Id: I390a2da2b8b9ed81d215ce58375911019c2228dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2631287
Commit-Queue: Eugene But <eugenebut@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844349}
parent 348f15c9
......@@ -108,6 +108,18 @@ enum class MobileSessionAppState {
kMaxValue = BackgroundXte
};
// Values of the Stability.iOS.Experimental.Counts histogram.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class IOSStabilityUserVisibleCrashType {
// Termination caused by system signal (f.e. EXC_BAD_ACCESS).
TerminationCausedBySystemSignal = 0,
// Termination caused by Hang / UI Thread freeze (ui thread was locked for 9+
// seconds and the app was quit by OS or the user).
TerminationCausedByHang = 1,
kMaxValue = TerminationCausedByHang
};
// Returns value to log for Stability.iOS.UTE.MobileSessionOOMShutdownHint
// histogram.
MobileSessionOomShutdownHint GetMobileSessionOomShutdownHint(
......@@ -157,6 +169,33 @@ GetMobileSessionAppWillTerminateWasReceived(bool has_possible_explanation) {
: MobileSessionAppWillTerminateWasReceived::WasReceivedForUte;
}
// Records Stability.iOS.Experimental.Counts if necessary.
void LogStabilityIOSExperimentalCounts(
MobileSessionShutdownType shutdown_type) {
IOSStabilityUserVisibleCrashType type =
IOSStabilityUserVisibleCrashType::kMaxValue;
switch (shutdown_type) {
case SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_WITH_MEMORY_WARNING:
case SHUTDOWN_IN_FOREGROUND_WITH_CRASH_LOG_NO_MEMORY_WARNING:
type = IOSStabilityUserVisibleCrashType::TerminationCausedBySystemSignal;
break;
case SHUTDOWN_IN_FOREGROUND_WITH_MAIN_THREAD_FROZEN:
type = IOSStabilityUserVisibleCrashType::TerminationCausedByHang;
break;
case SHUTDOWN_IN_BACKGROUND:
case SHUTDOWN_IN_FOREGROUND_NO_CRASH_LOG_NO_MEMORY_WARNING:
case SHUTDOWN_IN_FOREGROUND_NO_CRASH_LOG_WITH_MEMORY_WARNING:
case FIRST_LAUNCH_AFTER_UPGRADE:
case MOBILE_SESSION_SHUTDOWN_TYPE_COUNT:
// Nothing to record.
return;
};
UMA_STABILITY_HISTOGRAM_ENUMERATION(
"Stability.iOS.Experimental.Counts", type,
IOSStabilityUserVisibleCrashType::kMaxValue);
}
// Logs |type| in the shutdown type histogram.
void LogShutdownType(MobileSessionShutdownType type) {
UMA_STABILITY_HISTOGRAM_ENUMERATION("Stability.MobileSessionShutdownType",
......@@ -297,6 +336,8 @@ void MobileSessionShutdownMetricsProvider::ProvidePreviousSessionData(
UMA_STABILITY_HISTOGRAM_COUNTS_100("Stability.iOS.TabCountBeforeCrash",
allTabCount);
LogStabilityIOSExperimentalCounts(shutdown_type);
// Log metrics to improve categorization of crashes.
LogApplicationBackgroundedTime(session_info.sessionEndTime);
......
......@@ -39791,6 +39791,19 @@ Called by update_gpu_driver_bug_workaround_entries.py.-->
<int value="3" label="Actions"/>
</enum>
<enum name="IOSStabilityUserVisibleTerminationType">
<summary>
One of several separate stability metrics. The values are non-contiguous as
they are a subset of values matching fields of the Stability proto (from the
SystemProfile).
</summary>
<int value="0"
label="Termination caused by system signal (f.e. EXC_BAD_ACCESS)"/>
<int value="1"
label="Termination caused by Hang / UI Thread freeze (ui thread was
locked for 9+ seconds and the app was quit by OS or the user)."/>
</enum>
<enum name="IOSTabSwitcherPageChangeInteraction">
<int value="0" label="Unknown Interaction"/>
<int value="1" label="Scroll View Drag"/>
......@@ -345,6 +345,25 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="Stability.IOS.Experimental.Counts"
enum="IOSStabilityUserVisibleTerminationType" expires_after="2021-06-15">
<owner>eugenebut@chromium.org</owner>
<owner>olivierrobin@chromium.org</owner>
<summary>
Recorded when iOS app has started after a crash caused by system signal or
hang. Not recorded when app has started after UTE / XTE or started after
Chrome update. See go/bling-stability-101 for information about signal
crashes, hangs, UTEs and XTEs. This metric intends to complement
Stability.Counts. Stability.Counts does include UTEs / XTEs and thus is a
noisy metric which significantly overcounts user-visible crashes.
Stability.IOS.Experimental.Counts is not recorded on OOM crashes, so it does
not represent all user-visible crashes, but OOMs are so rare in Chrome for
iOS that Stability.IOS.Experimental.Counts is still a good proxy for
user-visible crashes. IOS.MetricKit.ForegroundExitData includes OOM crashes
(iOS 14 and higher) and can be used in conjunction with this metric.
</summary>
</histogram>
<histogram name="Stability.iOS.TabCountBefore{Event}" units="tabs"
expires_after="2021-05-05">
<owner>djean@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