File: borealis_metrics.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (156 lines) | stat: -rw-r--r-- 5,230 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_ASH_BOREALIS_BOREALIS_METRICS_H_
#define CHROME_BROWSER_ASH_BOREALIS_BOREALIS_METRICS_H_

#include "base/time/time.h"
#include "chrome/browser/ash/borealis/borealis_types.mojom-forward.h"

namespace borealis {

extern const char kBorealisInstallNumAttemptsHistogram[];
extern const char kBorealisInstallResultHistogram[];
extern const char kBorealisInstallSourceHistogram[];
extern const char kBorealisInstallOverallTimeHistogram[];
extern const char kBorealisShutdownNumAttemptsHistogram[];
extern const char kBorealisShutdownResultHistogram[];
extern const char kBorealisStabilityHistogram[];
extern const char kBorealisStartupNumAttemptsHistogram[];
extern const char kBorealisStartupResultHistogram[];
extern const char kBorealisStartupOverallTimeHistogram[];
extern const char kBorealisUninstallNumAttemptsHistogram[];
extern const char kBorealisUninstallResultHistogram[];

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class BorealisLaunchSource {
  kUnknown = 0,
  kInstallUrl = 1,
  kUnifiedAppInstaller = 2,
  kSteamInstallerApp = 3,
  kInsertCoin = 4,
  kAppUninstaller = 5,
  kAppUrlHandler = 6,
  kErrorDialogRetryButton = 7,
  kPostInstallLaunch = 8,
  kMaxValue = kPostInstallLaunch,
};

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class BorealisUninstallResult {
  kSuccess = 0,
  kAlreadyInProgress = 1,
  kShutdownFailed = 2,
  kRemoveDiskFailed = 3,
  kRemoveDlcFailed = 4,
  kMaxValue = kRemoveDlcFailed,
};

// 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, // No longer used, expanded into kDlc*.
  kDiskImageFailed = 3,
  kStartVmFailed = 4,
  kAwaitBorealisStartupFailed = 5,
  kSyncDiskFailed = 6,
  kRequestWaylandFailed = 7,
  kDisallowed = 8,
  kDlcCancelled = 9,
  kDlcOffline = 10,
  kDlcNeedUpdateError = 11,
  kDlcNeedRebootError = 12,
  kDlcNeedSpaceError = 13,
  kDlcBusyError = 14,
  kDlcInternalError = 15,
  kDlcUnsupportedError = 16,
  kDlcUnknownError = 17,
  kConciergeUnavailable = 18,
  kEmptyDiskResponse = 19,
  kStartVmEmptyResponse = 20,
  // Remember to add new entries to histograms/enums.xml.
  kMaxValue = kStartVmEmptyResponse,
};

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class BorealisGetDiskInfoResult {
  kSuccess = 0,
  kAlreadyInProgress = 1,
  kFailedGettingExpandableSpace = 2,
  kConciergeFailed = 3,
  kInvalidRequest = 4,
  kMaxValue = kInvalidRequest,
};

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class BorealisResizeDiskResult {
  kSuccess = 0,
  kAlreadyInProgress = 1,
  kFailedToGetDiskInfo = 2,
  kInvalidDiskType = 3,
  kNotEnoughExpandableSpace = 4,
  kWouldNotLeaveEnoughSpace = 5,
  kViolatesMinimumSize = 6,
  kConciergeFailed = 7,
  kFailedGettingUpdate = 8,
  kInvalidRequest = 9,
  kOverflowError = 10,
  kFailedToFulfillRequest = 11,
  kMaxValue = kFailedToFulfillRequest,
};

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class BorealisSyncDiskSizeResult {
  kDiskNotFixed = 0,
  kNoActionNeeded = 1,
  kNotEnoughSpaceToExpand = 2,
  kResizedPartially = 3,
  kResizedSuccessfully = 4,
  kAlreadyInProgress = 5,
  kFailedToGetDiskInfo = 6,
  kResizeFailed = 7,
  kDiskSizeSmallerThanMin = 8,
  kMaxValue = kDiskSizeSmallerThanMin,
};

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class BorealisShutdownResult {
  kSuccess = 0,
  kInProgress = 1,
  kFailed = 2,
  kMaxValue = kFailed,
};

void RecordBorealisInstallNumAttemptsHistogram();
void RecordBorealisInstallResultHistogram(
    borealis::mojom::InstallResult install_result);
void RecordBorealisInstallSourceHistogram(BorealisLaunchSource install_source);
void RecordBorealisInstallOverallTimeHistogram(base::TimeDelta install_time);
void RecordBorealisLaunchSourceHistogram(BorealisLaunchSource launch_source);
void RecordBorealisUninstallNumAttemptsHistogram();
void RecordBorealisUninstallResultHistogram(
    BorealisUninstallResult uninstall_result);
void RecordBorealisStartupNumAttemptsHistogram();
void RecordBorealisStartupResultHistogram(BorealisStartupResult startup_result);
void RecordBorealisStartupOverallTimeHistogram(base::TimeDelta startup_time);
void RecordBorealisStartupTimeToFirstWindowHistogram(
    base::TimeDelta startup_time);
void RecordBorealisShutdownNumAttemptsHistogram();
void RecordBorealisShutdownResultHistogram(
    BorealisShutdownResult shutdown_result);

}  // namespace borealis

std::ostream& operator<<(std::ostream& stream,
                         borealis::BorealisStartupResult result);

#endif  // CHROME_BROWSER_ASH_BOREALIS_BOREALIS_METRICS_H_