summaryrefslogtreecommitdiff
path: root/metrics_utils_unittest.cc
AgeCommit message (Collapse)Author
2020-11-24update_engine: Use PrefsInterface from SystemStateAmin Hassani
There is no need to pass the Pref class around (at least not in cros) since we have the SystemState as the global context and we can get the pref from there. BUG=b:171829801 TEST=cros_workon_make --board reef --test update_engine Change-Id: I9f5fb8a118fab2ef0e188c42f746dafb1094972c Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2548740 Tested-by: Amin Hassani <ahassani@chromium.org> Commit-Queue: Jae Hoon Kim <kimjae@chromium.org> Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
2020-11-24update_engine: Use clock and fake clock from SystemStateAmin Hassani
No need to pass clock and fake clock anywhere anymore. This CL makes it to just use those objects available from SystemState and FakeSystemState. BUG=b:171829801 TEST=cros_workon_make --board reef --test update_engine Change-Id: I9a3cf6dd2057620c11b862d3317b83489c76f3ca Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2546625 Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Jae Hoon Kim <kimjae@chromium.org> Commit-Queue: Jae Hoon Kim <kimjae@chromium.org>
2020-11-03update_engine: Create cros vs. aosp boundary clearAmin Hassani
Its time to make the boundary between Chrome OS and Android code more clear. This CL moves all CrOS only code to "chromeos" directory and the same for Android (in "android" directory). This way we would easily know which code is uses in which project and can keep the code cleaner and more maintainable. One big remaining problem is download_action* files. It seems like DownloadAction class does a lot of things that chrome OS needs and it depends on a lot of Chrome OS stuff, but Android is also using thie Action in a way that circumvent the Chrome OS stuff. For example Android checks for SystemState to be nullptr to not do things. This is really fragile and needs to change. Probably Android Team has to implement their own DownloadAction of some sort and not re use the Chrome OS one in a very fragile way. Removed a few android files that have not been used anywhere. Changed some clang-format and lint issues in order to pass preupload. BUG=b:171829801 TEST=cros_workon_make --board reef --test update_engine Change-Id: I3fff1d4a100a065a5c1484a845241b5521614d9f Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2508965 Tested-by: Amin Hassani <ahassani@chromium.org> Auto-Submit: Amin Hassani <ahassani@chromium.org> Reviewed-by: Jae Hoon Kim <kimjae@chromium.org> Reviewed-by: Tianjie Xu <xunchang@google.com> Reviewed-by: Kelvin Zhang <zhangkelvin@google.com> Commit-Queue: Amin Hassani <ahassani@chromium.org>
2019-08-15update_engine: Remove references to bluetooth and wimaxAlex Khouderchah
Shill does not support bluetooth (kTypeBluetooth is left over from the flimflam API) and has stopped supporting Wimax. BUG=chromium:954635 TEST=`FEATURES="test" emerge-$BOARD update_engine update_engine-client` Change-Id: I3e7d4f0b0a7625067585b6f9fdeec196b87f7026 Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1752329 Reviewed-by: Amin Hassani <ahassani@chromium.org> Tested-by: Alex Khouderchah <akhouderchah@chromium.org> Commit-Queue: Alex Khouderchah <akhouderchah@chromium.org>
2019-01-16update_engine: Run clang-format on ./ (root directory)Amin Hassani
BUG=none TEST=unittest Change-Id: Ibd075dc7ea9a18e798f612e35725f1c83c112809 Reviewed-on: https://chromium-review.googlesource.com/1409708 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
2018-11-18update_engine: Add disconnected network type for metrics reportingColin Howes
On a failed update, correctly report that the network is disconnected rather than reporting an "unknown" network type, which is set when the connection type cannot be determined based on the properties of a given service path. BUG=chromium:660283 TEST=Added relevant unittests. Also tested manually by updating via cros flash, unplugging Ethernet after the transfer, and killing the dev_server. Metrics sends "disconnected" as expected. Change-Id: Ia681b769208b67fb5c14d41a646d816a42ccf33e Reviewed-on: https://chromium-review.googlesource.com/1231700 Commit-Ready: Colin Howes <chowes@google.com> Tested-by: Colin Howes <chowes@google.com> Reviewed-by: Amin Hassani <ahassani@chromium.org>
2016-06-07Move ParseConnection*() to connection_utils.Sen Jiang
We don't need real_shill_provider if USE_DBUS is 0, but we still need these functions, and they have a duplicate copy in connection_manager, so put them in utils and deduplicate. Also moved StringForConnectionType() to connection_utils. Bug: 28800946 Test: mma Change-Id: If535fdc52bc8fb267921bea02b31d8d6580d5d54
2015-11-17Move metrics time helpers to metrics_utils.Alex Deymo
The metrics module reports metrics periodically, for which it needs to keep track of the duration since some events (for example, the update finished). These helpers were in the common/utils.h, but they rely on the global SystemState to access both Prefs and Clock. Since these helpers are specific to the metric reporting, this CL moves them to the metrics_utils.h module. Bug: 25197634 TEST=FEATURES=test emerge-link update_engine; mmma system/update_engine Change-Id: Ia48091adbdc56c339c69c86c91c5c01aa58c54fb
2015-11-12common: Split out metrics utils from utils.cc.Alex Deymo
The utility functions to convert error codes and network settings to the types defined by the metrics framework are split out the utils.cc file. These tools are only used by the update_engine daemon to report back metrics on an update check. Bug: 25197634 Test: FEATURES=test emerge-link update_engine; mma Change-Id: I589dc9f6056fb1399fa84ca4f44076ed3a6b5365