blob: f6d0c74e57ee1bc123930cc8d61f18d256a136f9 [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
63 // This error code is used to convey that malformed input was given
64 // to the utils::GetDownloadErrorCode() function. This should never
65 // happen but if it does it's because of an internal update_engine
66 // error and we're interested in knowing this.
67 kInputMalformed = 100,
68
69 // Bucket for capturing HTTP status codes not in the 200-599
70 // range. This should never happen in practice but if it does we
71 // want to know.
72 kHttpStatusOther = 101,
73
74 // Above 200 and below 600, the value is the HTTP status code.
75 kHttpStatus200 = 200,
76
77 kNumConstants = 600,
78
79 kUnset = -1
80};
81
82// Possible ways an update attempt can end.
83//
84// This is used in the UpdateEngine.Attempt.Result histogram.
85enum class AttemptResult {
86 kUpdateSucceeded, // The update succeeded.
87 kInternalError, // An internal error occurred.
88 kPayloadDownloadError, // Failure while downloading payload.
89 kMetadataMalformed, // Metadata was malformed.
90 kOperationMalformed, // An operation was malformed.
91 kOperationExecutionError, // An operation failed to execute.
92 kMetadataVerificationFailed, // Metadata verification failed.
93 kPayloadVerificationFailed, // Payload verification failed.
94 kVerificationFailed, // Root or Kernel partition verification failed.
95 kPostInstallFailed, // The postinstall step failed.
96 kAbnormalTermination, // The attempt ended abnormally.
97 kUpdateCanceled, // Update canceled by the user.
98
99 kNumConstants,
100
101 kUnset = -1
102};
103
104// Possible ways the device is connected to the Internet.
105//
106// This is used in the UpdateEngine.Attempt.ConnectionType histogram.
107enum class ConnectionType {
108 kUnknown, // Unknown.
109 kEthernet, // Ethernet.
110 kWifi, // Wireless.
111 kWimax, // WiMax.
112 kBluetooth, // Bluetooth.
113 kCellular, // Cellular.
114 kTetheredEthernet, // Tethered (Ethernet).
115 kTetheredWifi, // Tethered (Wifi).
116
117 kNumConstants,
118 kUnset = -1
119};
120
121// Possible ways a rollback can end.
122//
123// This is used in the UpdateEngine.Rollback histogram.
124enum class RollbackResult {
125 kFailed,
126 kSuccess,
127
128 kNumConstants
129};
130
131} // namespace metrics
132
133} // namespace chromeos_update_engine
134
135#endif // UPDATE_ENGINE_METRICS_CONSTANTS_H_