Add new metrics.

The current metrics (Installer.* namespace) have several shortcomings,
for example it's not immediately clear when and how frequent each
metric is reported. This CL introduces new metrics that addresses this
and other problems. The new metrics are all in the UpdateEngine.*
namespace and fall into five categories

 UpdateEngine.Daily.*               Reported daily.
 UpdateEngine.Check.*               On every check.
 UpdateEngine.Attempt.*             On every attempt.
 UpdateEngine.SuccessfulUpdate.*    With every successful update.
 UpdateEngine.*                     Miscellaneous

Most of the new metrics mimic existing metrics and also leverage the
existing code, book-keeping and unit tests. The plan is to remove the
Installer.* metrics once we're happy with the new ones.

I've also tested this manually by performing updates and verifying
that chrome://histograms looks correct.

BUG=chromium:355745
TEST=New unit tests + unit tests pass + manual testing.

Change-Id: I7a3f68d75910384b116c7e4664776e25d3997584
Reviewed-on: https://chromium-review.googlesource.com/191314
Reviewed-by: David Zeuthen <[email protected]>
Tested-by: David Zeuthen <[email protected]>
Commit-Queue: David Zeuthen <[email protected]>
17 files changed
tree: 0692f393085319335bad05834439e95da1998d80
  1. init/
  2. policy_manager/
  3. .gitignore
  4. 99-gpio-dutflag.rules
  5. action.h
  6. action_mock.h
  7. action_pipe.h
  8. action_pipe_unittest.cc
  9. action_processor.cc
  10. action_processor.h
  11. action_processor_mock.h
  12. action_processor_unittest.cc
  13. action_unittest.cc
  14. build
  15. bzip.cc
  16. bzip.h
  17. bzip_extent_writer.cc
  18. bzip_extent_writer.h
  19. bzip_extent_writer_unittest.cc
  20. certificate_checker.cc
  21. certificate_checker.h
  22. certificate_checker_mock.h
  23. certificate_checker_unittest.cc
  24. chrome_browser_proxy_resolver.cc
  25. chrome_browser_proxy_resolver.h
  26. chrome_browser_proxy_resolver_unittest.cc
  27. clock.cc
  28. clock.h
  29. clock_interface.h
  30. connection_manager.cc
  31. connection_manager.h
  32. connection_manager_unittest.cc
  33. constants.cc
  34. constants.h
  35. cycle_breaker.cc
  36. cycle_breaker.h
  37. cycle_breaker_unittest.cc
  38. dbus_constants.h
  39. dbus_service.cc
  40. dbus_service.h
  41. dbus_wrapper_interface.h
  42. delta_diff_generator.cc
  43. delta_diff_generator.h
  44. delta_diff_generator_unittest.cc
  45. delta_performer.cc
  46. delta_performer.h
  47. delta_performer_unittest.cc
  48. download_action.cc
  49. download_action.h
  50. download_action_unittest.cc
  51. error_code.h
  52. extent_mapper.cc
  53. extent_mapper.h
  54. extent_mapper_unittest.cc
  55. extent_ranges.cc
  56. extent_ranges.h
  57. extent_ranges_unittest.cc
  58. extent_writer.cc
  59. extent_writer.h
  60. extent_writer_unittest.cc
  61. fake_clock.h
  62. fake_hardware.h
  63. fake_p2p_manager.h
  64. fake_p2p_manager_configuration.h
  65. file_descriptor.cc
  66. file_descriptor.h
  67. file_writer.cc
  68. file_writer.h
  69. file_writer_mock.h
  70. file_writer_unittest.cc
  71. filesystem_copier_action.cc
  72. filesystem_copier_action.h
  73. filesystem_copier_action_unittest.cc
  74. filesystem_iterator.cc
  75. filesystem_iterator.h
  76. filesystem_iterator_unittest.cc
  77. full_update_generator.cc
  78. full_update_generator.h
  79. full_update_generator_unittest.cc
  80. gen_coverage_html
  81. generate_delta_main.cc
  82. gpio_handler.cc
  83. gpio_handler.h
  84. gpio_handler_unittest.cc
  85. gpio_handler_unittest.h
  86. gpio_mock_file_descriptor.cc
  87. gpio_mock_file_descriptor.h
  88. gpio_mock_udev_interface.cc
  89. gpio_mock_udev_interface.h
  90. graph_types.h
  91. graph_utils.cc
  92. graph_utils.h
  93. graph_utils_unittest.cc
  94. hardware.cc
  95. hardware.h
  96. hardware_interface.h
  97. http_common.cc
  98. http_common.h
  99. http_fetcher.cc
  100. http_fetcher.h
  101. http_fetcher_unittest.cc
  102. hwid_override.cc
  103. hwid_override.h
  104. hwid_override_unittest.cc
  105. inherit-review-settings-ok
  106. install_plan.cc
  107. install_plan.h
  108. libcurl_http_fetcher.cc
  109. libcurl_http_fetcher.h
  110. LICENSE
  111. local_coverage_rate
  112. main.cc
  113. metadata.cc
  114. metadata.h
  115. metadata_unittest.cc
  116. metrics.cc
  117. metrics.h
  118. mock_connection_manager.h
  119. mock_dbus_wrapper.h
  120. mock_file_writer.h
  121. mock_gpio_handler.h
  122. mock_hardware.h
  123. mock_http_fetcher.cc
  124. mock_http_fetcher.h
  125. mock_p2p_manager.h
  126. mock_payload_state.h
  127. mock_system_state.cc
  128. mock_system_state.h
  129. multi_range_http_fetcher.cc
  130. multi_range_http_fetcher.h
  131. omaha_hash_calculator.cc
  132. omaha_hash_calculator.h
  133. omaha_hash_calculator_unittest.cc
  134. omaha_request_action.cc
  135. omaha_request_action.h
  136. omaha_request_action_unittest.cc
  137. omaha_request_params.cc
  138. omaha_request_params.h
  139. omaha_request_params_unittest.cc
  140. omaha_response.h
  141. omaha_response_handler_action.cc
  142. omaha_response_handler_action.h
  143. omaha_response_handler_action_unittest.cc
  144. p2p_manager.cc
  145. p2p_manager.h
  146. p2p_manager_unittest.cc
  147. payload_signer.cc
  148. payload_signer.h
  149. payload_signer_unittest.cc
  150. payload_state.cc
  151. payload_state.h
  152. payload_state_interface.h
  153. payload_state_unittest.cc
  154. postinstall_runner_action.cc
  155. postinstall_runner_action.h
  156. postinstall_runner_action_unittest.cc
  157. prefs.cc
  158. prefs.h
  159. prefs_interface.h
  160. prefs_mock.h
  161. prefs_unittest.cc
  162. proxy_resolver.cc
  163. proxy_resolver.h
  164. real_dbus_wrapper.h
  165. real_system_state.cc
  166. real_system_state.h
  167. run_unittests
  168. sample_omaha_v3_response.xml
  169. SConstruct
  170. simple_key_value_store.cc
  171. simple_key_value_store.h
  172. simple_key_value_store_unittest.cc
  173. subprocess.cc
  174. subprocess.h
  175. subprocess_unittest.cc
  176. system_state.h
  177. tarjan.cc
  178. tarjan.h
  179. tarjan_unittest.cc
  180. terminator.cc
  181. terminator.h
  182. terminator_unittest.cc
  183. test_http_server.cc
  184. test_utils.cc
  185. test_utils.h
  186. testrunner.cc
  187. topological_sort.cc
  188. topological_sort.h
  189. topological_sort_unittest.cc
  190. udev_interface.h
  191. unittest_key.pem
  192. unittest_key2.pem
  193. update_attempter.cc
  194. update_attempter.h
  195. update_attempter_mock.h
  196. update_attempter_unittest.cc
  197. update_check_scheduler.cc
  198. update_check_scheduler.h
  199. update_check_scheduler_unittest.cc
  200. update_engine.xml
  201. update_engine_client.cc
  202. update_metadata.proto
  203. UpdateEngine.conf
  204. utils.cc
  205. utils.h
  206. utils_unittest.cc
  207. WATCHLISTS
  208. zip_unittest.cc