Tianjie Xu | 282aa1f | 2017-09-05 13:42:45 -0700 | [diff] [blame] | 1 | // |
| 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 | |
| 20 | namespace chromeos_update_engine { |
| 21 | |
| 22 | namespace metrics { |
| 23 | // The possible outcomes when checking for updates. |
| 24 | // |
| 25 | // This is used in the UpdateEngine.Check.Result histogram. |
| 26 | enum 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. |
| 40 | enum 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. |
| 54 | enum 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. |
| 85 | enum 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. |
Sen Jiang | fe52282 | 2017-10-31 15:14:11 -0700 | [diff] [blame] | 98 | kUpdateSucceededNotActive, // Update succeeded but the new slot is not |
| 99 | // active. |
Tianjie Xu | 282aa1f | 2017-09-05 13:42:45 -0700 | [diff] [blame] | 100 | |
| 101 | kNumConstants, |
| 102 | |
| 103 | kUnset = -1 |
| 104 | }; |
| 105 | |
| 106 | // Possible ways the device is connected to the Internet. |
| 107 | // |
| 108 | // This is used in the UpdateEngine.Attempt.ConnectionType histogram. |
| 109 | enum class ConnectionType { |
| 110 | kUnknown, // Unknown. |
| 111 | kEthernet, // Ethernet. |
| 112 | kWifi, // Wireless. |
| 113 | kWimax, // WiMax. |
| 114 | kBluetooth, // Bluetooth. |
| 115 | kCellular, // Cellular. |
| 116 | kTetheredEthernet, // Tethered (Ethernet). |
| 117 | kTetheredWifi, // Tethered (Wifi). |
| 118 | |
| 119 | kNumConstants, |
| 120 | kUnset = -1 |
| 121 | }; |
| 122 | |
| 123 | // Possible ways a rollback can end. |
| 124 | // |
| 125 | // This is used in the UpdateEngine.Rollback histogram. |
| 126 | enum class RollbackResult { |
| 127 | kFailed, |
| 128 | kSuccess, |
| 129 | |
| 130 | kNumConstants |
| 131 | }; |
| 132 | |
| 133 | } // namespace metrics |
| 134 | |
| 135 | } // namespace chromeos_update_engine |
| 136 | |
| 137 | #endif // UPDATE_ENGINE_METRICS_CONSTANTS_H_ |