Move metrics time helpers to metrics_utils.

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
9 files changed
tree: fcf201e5f2b7d2502337be9c711343b1842b7fb0
  1. client_library/
  2. common/
  3. dbus_bindings/
  4. include/
  5. init/
  6. payload_consumer/
  7. payload_generator/
  8. sample_images/
  9. update_manager/
  10. update_payload_key/
  11. .gitignore
  12. Android.mk
  13. chrome_browser_proxy_resolver.cc
  14. chrome_browser_proxy_resolver.h
  15. chrome_browser_proxy_resolver_unittest.cc
  16. connection_manager.cc
  17. connection_manager.h
  18. connection_manager_interface.h
  19. connection_manager_unittest.cc
  20. daemon.cc
  21. daemon.h
  22. dbus_service.cc
  23. dbus_service.h
  24. dbus_service_unittest.cc
  25. dbus_test_utils.h
  26. fake_file_writer.h
  27. fake_p2p_manager.h
  28. fake_p2p_manager_configuration.h
  29. fake_shill_proxy.cc
  30. fake_shill_proxy.h
  31. fake_system_state.cc
  32. fake_system_state.h
  33. generate_pc_file.sh
  34. image_properties.h
  35. image_properties_android.cc
  36. image_properties_chromeos.cc
  37. libcros_proxy.cc
  38. libcros_proxy.h
  39. libupdate_engine-client-test.pc.in
  40. libupdate_engine-client.pc.in
  41. local_coverage_rate
  42. main.cc
  43. metrics.cc
  44. metrics.h
  45. metrics_utils.cc
  46. metrics_utils.h
  47. metrics_utils_unittest.cc
  48. mock_action.h
  49. mock_action_processor.h
  50. mock_connection_manager.h
  51. mock_file_writer.h
  52. mock_omaha_request_params.h
  53. mock_p2p_manager.h
  54. mock_payload_state.h
  55. mock_update_attempter.h
  56. MODULE_LICENSE_APACHE2
  57. NOTICE
  58. omaha_request_action.cc
  59. omaha_request_action.h
  60. omaha_request_action_unittest.cc
  61. omaha_request_params.cc
  62. omaha_request_params.h
  63. omaha_request_params_unittest.cc
  64. omaha_response.h
  65. omaha_response_handler_action.cc
  66. omaha_response_handler_action.h
  67. omaha_response_handler_action_unittest.cc
  68. OWNERS
  69. p2p_manager.cc
  70. p2p_manager.h
  71. p2p_manager_unittest.cc
  72. payload_state.cc
  73. payload_state.h
  74. payload_state_interface.h
  75. payload_state_unittest.cc
  76. PRESUBMIT.cfg
  77. proxy_resolver.cc
  78. proxy_resolver.h
  79. real_system_state.cc
  80. real_system_state.h
  81. run_unittests
  82. sample_omaha_v3_response.xml
  83. shill_proxy.cc
  84. shill_proxy.h
  85. shill_proxy_interface.h
  86. system_state.h
  87. tar_bunzip2.gypi
  88. test_http_server.cc
  89. testrunner.cc
  90. unittest_key.pem
  91. unittest_key2.pem
  92. update_attempter.cc
  93. update_attempter.h
  94. update_attempter_unittest.cc
  95. update_engine-client.gyp
  96. update_engine.conf
  97. update_engine.gyp
  98. update_engine.rc
  99. update_engine_client.cc
  100. update_metadata.proto
  101. update_status_utils.cc
  102. update_status_utils.h
  103. UpdateEngine.conf
  104. WATCHLISTS