blob: b3833a3db24b8fa357c077a876b405a1a0172f8d [file] [log] [blame]
Tianjie Xu282aa1f2017-09-05 13:42:45 -07001//
2// Copyright (C) 2017 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17#ifndef UPDATE_ENGINE_METRICS_CONSTANTS_H_
18#define UPDATE_ENGINE_METRICS_CONSTANTS_H_
19
20namespace chromeos_update_engine {
21
22namespace metrics {
23// The possible outcomes when checking for updates.
24//
25// This is used in the UpdateEngine.Check.Result histogram.
26enum class CheckResult {
27 kUpdateAvailable, // Response indicates an update is available.
28 kNoUpdateAvailable, // Response indicates no updates are available.
29 kDownloadError, // Error downloading response from Omaha.
30 kParsingError, // Error parsing response.
31 kRebootPending, // No update check was performed a reboot is pending.
32
33 kNumConstants,
34 kUnset = -1
35};
36
37// Possible ways a device can react to a new update being available.
38//
39// This is used in the UpdateEngine.Check.Reaction histogram.
40enum class CheckReaction {
41 kUpdating, // Device proceeds to download and apply update.
42 kIgnored, // Device-policy dictates ignoring the update.
43 kDeferring, // Device-policy dictates waiting.
44 kBackingOff, // Previous errors dictates waiting.
45
46 kNumConstants,
47 kUnset = -1
48};
49
50// The possible ways that downloading from a HTTP or HTTPS server can fail.
51//
52// This is used in the UpdateEngine.Check.DownloadErrorCode and
53// UpdateEngine.Attempt.DownloadErrorCode histograms.
54enum class DownloadErrorCode {
55 // Errors that can happen in the field. See http://crbug.com/355745
56 // for how we plan to add more detail in the future.
57 kDownloadError = 0, // Error downloading data from server.
58
59 // IMPORTANT: When adding a new error code, add at the bottom of the
60 // above block and before the kInputMalformed field. This
61 // is to ensure that error codes are not reordered.
62
Xiaochu Liu4a1173a2019-04-10 10:49:08 -070063 // This error is reported when libcurl has an internal error that
64 // update_engine can't recover from.
65 kInternalError = 99,
66
Tianjie Xu282aa1f2017-09-05 13:42:45 -070067 // This error code is used to convey that malformed input was given
68 // to the utils::GetDownloadErrorCode() function. This should never
69 // happen but if it does it's because of an internal update_engine
70 // error and we're interested in knowing this.
71 kInputMalformed = 100,
72
73 // Bucket for capturing HTTP status codes not in the 200-599
74 // range. This should never happen in practice but if it does we
75 // want to know.
76 kHttpStatusOther = 101,
77
78 // Above 200 and below 600, the value is the HTTP status code.
79 kHttpStatus200 = 200,
80
81 kNumConstants = 600,
82
83 kUnset = -1
84};
85
86// Possible ways an update attempt can end.
87//
88// This is used in the UpdateEngine.Attempt.Result histogram.
89enum class AttemptResult {
90 kUpdateSucceeded, // The update succeeded.
91 kInternalError, // An internal error occurred.
92 kPayloadDownloadError, // Failure while downloading payload.
93 kMetadataMalformed, // Metadata was malformed.
94 kOperationMalformed, // An operation was malformed.
95 kOperationExecutionError, // An operation failed to execute.
96 kMetadataVerificationFailed, // Metadata verification failed.
97 kPayloadVerificationFailed, // Payload verification failed.
98 kVerificationFailed, // Root or Kernel partition verification failed.
99 kPostInstallFailed, // The postinstall step failed.
100 kAbnormalTermination, // The attempt ended abnormally.
101 kUpdateCanceled, // Update canceled by the user.
Sen Jiang02c49422017-10-31 15:14:11 -0700102 kUpdateSucceededNotActive, // Update succeeded but the new slot is not
103 // active.
Tianjie Xu282aa1f2017-09-05 13:42:45 -0700104
105 kNumConstants,
106
107 kUnset = -1
108};
109
110// Possible ways the device is connected to the Internet.
111//
112// This is used in the UpdateEngine.Attempt.ConnectionType histogram.
113enum class ConnectionType {
Colin Howesc9e98d62018-09-18 10:35:20 -0700114 kUnknown = 0, // Unknown.
115 kEthernet = 1, // Ethernet.
116 kWifi = 2, // Wireless.
117 kWimax = 3, // WiMax.
118 kBluetooth = 4, // Bluetooth.
119 kCellular = 5, // Cellular.
120 kTetheredEthernet = 6, // Tethered (Ethernet).
121 kTetheredWifi = 7, // Tethered (Wifi).
122 kDisconnected = 8, // Disconnected.
Tianjie Xu282aa1f2017-09-05 13:42:45 -0700123
124 kNumConstants,
125 kUnset = -1
126};
127
128// Possible ways a rollback can end.
129//
130// This is used in the UpdateEngine.Rollback histogram.
131enum class RollbackResult {
132 kFailed,
133 kSuccess,
134
135 kNumConstants
136};
137
138} // namespace metrics
139
140} // namespace chromeos_update_engine
141
142#endif // UPDATE_ENGINE_METRICS_CONSTANTS_H_