Commit 47bfe451 authored by danielng's avatar danielng Committed by Commit Bot

borealis: adding startup metrics

Adding metrics that will be used to recorded information about the
borealis startup sequence. These will help to measure performance,
usage and where errors are occurring.

Bug: b/171339461
Change-Id: Id5fae11f5bcf57d4fb659c7c6e7b9eba2cfe985c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2509072
Commit-Queue: Daniel Ng <danielng@google.com>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarNic Hollingum <hollingum@google.com>
Cr-Commit-Position: refs/heads/master@{#825617}
parent ed0e9bbb
......@@ -861,6 +861,8 @@ source_set("chromeos") {
"borealis/borealis_installer_impl.h",
"borealis/borealis_launch_watcher.cc",
"borealis/borealis_launch_watcher.h",
"borealis/borealis_metrics.cc",
"borealis/borealis_metrics.h",
"borealis/borealis_prefs.cc",
"borealis/borealis_prefs.h",
"borealis/borealis_service.cc",
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/borealis/borealis_metrics.h"
namespace borealis {
const char kBorealisStartupNumAttemptsHistogram[] =
"Borealis.Startup.NumAttempts";
const char kBorealisStartupResultHistogram[] = "Borealis.Startup.Result";
const char kBorealisStartupOverallTimeHistogram[] =
"Borealis.Startup.OverallTime";
void RecordBorealisStartupNumAttemptsHistogram() {
base::UmaHistogramBoolean(kBorealisStartupNumAttemptsHistogram, true);
}
void RecordBorealisStartupResultHistogram(
BorealisStartupResult startup_result) {
base::UmaHistogramEnumeration(kBorealisStartupResultHistogram,
startup_result);
}
void RecordBorealisStartupOverallTimeHistogram(base::TimeDelta startup_time) {
base::UmaHistogramTimes(kBorealisStartupOverallTimeHistogram, startup_time);
}
} // namespace borealis
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_BOREALIS_BOREALIS_METRICS_H_
#define CHROME_BROWSER_CHROMEOS_BOREALIS_BOREALIS_METRICS_H_
#include "base/metrics/histogram_functions.h"
namespace borealis {
extern const char kBorealisStartupNumAttemptsHistogram[];
extern const char kBorealisStartupResultHistogram[];
extern const char kBorealisStartupOverallTimeHistogram[];
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class BorealisStartupResult {
kSuccess = 0,
kCancelled = 1,
kMountFailed = 2,
kDiskImageFailed = 3,
kStartVmFailed = 4,
kAwaitBorealisStartupFailed = 5,
kMaxValue = kAwaitBorealisStartupFailed,
};
void RecordBorealisStartupNumAttemptsHistogram();
void RecordBorealisStartupResultHistogram(BorealisStartupResult startup_result);
void RecordBorealisStartupOverallTimeHistogram(base::TimeDelta startup_time);
} // namespace borealis
#endif // CHROME_BROWSER_CHROMEOS_BOREALIS_BOREALIS_METRICS_H_
......@@ -8724,6 +8724,15 @@ Called by update_bad_message_reasons.py.-->
<int value="1" label="Yes"/>
</enum>
<enum name="BorealisStartupResult">
<int value="0" label="Success"/>
<int value="1" label="Cancelled"/>
<int value="2" label="Failed mounting DLC"/>
<int value="3" label="Failed creating disk image"/>
<int value="4" label="Failed starting VM"/>
<int value="5" label="Failed awaiting startup"/>
</enum>
<enum name="BoringSSLReasonCode">
<obsolete>
Removed in March 2016.
......@@ -31,6 +31,33 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="Borealis.Startup.NumAttempts" enum="BooleanAttempted"
expires_after="2021-11-01">
<owner>danielng@google.com</owner>
<owner>src/chrome/browser/chromeos/borealis/OWNERS</owner>
<summary>Recording every attempt to start Borealis (via the UI).</summary>
</histogram>
<histogram name="Borealis.Startup.OverallTime" units="ms"
expires_after="2021-11-01">
<owner>danielng@google.com</owner>
<owner>src/chrome/browser/chromeos/borealis/OWNERS</owner>
<summary>
Recording the time taken for each successful attempt to start Borealis (via
the UI).
</summary>
</histogram>
<histogram name="Borealis.Startup.Result" enum="BorealisStartupResult"
expires_after="2021-11-01">
<owner>danielng@google.com</owner>
<owner>src/chrome/browser/chromeos/borealis/OWNERS</owner>
<summary>
Recording the result of each attempt to start Borealis, whether it was
successful or the error that it faced.
</summary>
</histogram>
</histograms>
</histogram-configuration>
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