shill: wifi: track RoamTime, RoamComplete, and SessionLength from supplicant and
log to UMA

Supplicant is being modified to report a roam time and a roam success or failure
when a roam happens (CL:957430).

RoamTime (along with the auth mode) is reported whenever a successful roam happens.
This will allow us to see the difference between roam times with WPA-PSK vs. FT-PSK
and WPA-EAP vs. FT-EAP.

RoamComplete (along with the auth mode) is reported whenever a successful or
unsuccessful roam happens. This will allow us to see how FT affects the reliability
of roams; specifically, we can compare the proportion of successful roams to total
roams.

SessionLength (along with auth mode) is reported whenever a session ends. This will
allow us to see how FT affects session lengths (i.e. whether FT helps wifi
stability).

BUG=chromium:791202
TEST=(1a) With use_ft=False in network_WiFi_RoamFT autotest, ran EAP/PSK autotests,
          checked chrome://histograms to confirm that
          Network.Shill.WiFi.RoamComplete.{EAP/PSK} roam success incremented by 1,
          and Network.Shill.WiFi.RoamTime.{EAP/PSK} is ~300ms/~100ms
     (1b) With use_ft=True, ran FT-EAP and FT-PSK autotests, checked histograms to
          confirm that Network.Shill.WiFi.RoamComplete.{FTEAP/FTPSK} roam success
          incremented by 1, and Network.Shill.WiFi.RoamTime.{FTEAP/FTPSK} is
          ~150ms/~150ms.
     (1c) Commented out the section of the autotest that brings up the bridging
          setup, ran autotests, checked histograms to confirm that RoamComplete
          histograms have roam failures incremented by 1.
     (1d) Checked Network.Shill.WiFi.SessionLength.* histograms after running the
          autotests, and the values were ~5-~15s (approximately the time that DUT
          was connected to AP before roam).
     (2) Connected to my own Cisco APs with Caroline DUT. Triggered a roam by
         reducing tx power, and checked histograms to make sure they incremented as
         expected. RoamTimes for PSK/EAP/FTPSK/FTEAP were ~40ms/~200ms/~40ms/~40ms,
         RoamComplete incremented, and SessionLength was ~10s (amount of time
         after connecting and before roam was triggered).
     (3) Ran unit tests
CQ-DEPEND=CL:957430

Change-Id: I23bd181fef879fcc27acb7f686ac1c5eaba5d4fe
Reviewed-on: https://chromium-review.googlesource.com/957442
Commit-Ready: Matthew Wang <matthewmwang@chromium.org>
Tested-by: Matthew Wang <matthewmwang@chromium.org>
Reviewed-by: Matthew Wang <matthewmwang@chromium.org>
7 files changed
tree: b15c635093c49cf23fed5f67a2d765c9f07d852b
  1. .gitignore
  2. HACKING.md
  3. MODULE_LICENSE_APACHE2
  4. NETLINK_MESSAGES.txt
  5. NOTICE
  6. OWNERS
  7. PRESUBMIT.cfg
  8. TESTING
  9. accessor_interface.h
  10. active_link_monitor.cc
  11. active_link_monitor.h
  12. active_link_monitor_unittest.cc
  13. adaptor_interfaces.h
  14. async_connection.cc
  15. async_connection.h
  16. async_connection_unittest.cc
  17. bin/
  18. callbacks.h
  19. cellular/
  20. certificate_file.cc
  21. certificate_file.h
  22. certificate_file_unittest.cc
  23. connection.cc
  24. connection.h
  25. connection_diagnostics.cc
  26. connection_diagnostics.h
  27. connection_diagnostics_unittest.cc
  28. connection_health_checker.cc
  29. connection_health_checker.h
  30. connection_health_checker_unittest.cc
  31. connection_info.cc
  32. connection_info.h
  33. connection_info_reader.cc
  34. connection_info_reader.h
  35. connection_info_reader_unittest.cc
  36. connection_info_unittest.cc
  37. connection_tester.cc
  38. connection_tester.h
  39. connection_tester_unittest.cc
  40. connection_unittest.cc
  41. connectivity_trial.cc
  42. connectivity_trial.h
  43. connectivity_trial_unittest.cc
  44. control_interface.h
  45. crypto_des_cbc.cc
  46. crypto_des_cbc.h
  47. crypto_des_cbc_unittest.cc
  48. crypto_interface.h
  49. crypto_provider.cc
  50. crypto_provider.h
  51. crypto_provider_unittest.cc
  52. crypto_rot47.cc
  53. crypto_rot47.h
  54. crypto_rot47_unittest.cc
  55. crypto_util_proxy.cc
  56. crypto_util_proxy.h
  57. crypto_util_proxy_unittest.cc
  58. daemon_task.cc
  59. daemon_task.h
  60. daemon_task_unittest.cc
  61. dbus/
  62. dbus_bindings/
  63. dbus_properties_proxy_interface.h
  64. default_profile.cc
  65. default_profile.h
  66. default_profile_unittest.cc
  67. device.cc
  68. device.h
  69. device_claimer.cc
  70. device_claimer.h
  71. device_claimer_unittest.cc
  72. device_id.cc
  73. device_id.h
  74. device_info.cc
  75. device_info.h
  76. device_info_unittest.cc
  77. device_stub.h
  78. device_unittest.cc
  79. dhcp/
  80. dns_client.cc
  81. dns_client.h
  82. dns_client_factory.cc
  83. dns_client_factory.h
  84. dns_client_unittest.cc
  85. dns_server_tester.cc
  86. dns_server_tester.h
  87. dns_server_tester_unittest.cc
  88. dns_util.cc
  89. dns_util.h
  90. dns_util_unittest.cc
  91. doc/
  92. eap_credentials.cc
  93. eap_credentials.h
  94. eap_credentials_unittest.cc
  95. eap_listener.cc
  96. eap_listener.h
  97. eap_listener_unittest.cc
  98. eap_protocol.h
  99. ephemeral_profile.cc
  100. ephemeral_profile.h
  101. error.cc
  102. error.h
  103. error_unittest.cc
  104. ethernet/
  105. event_dispatcher.cc
  106. event_dispatcher.h
  107. external_task.cc
  108. external_task.h
  109. external_task_unittest.cc
  110. fake_store.cc
  111. fake_store.h
  112. file_io.cc
  113. file_io.h
  114. file_reader.cc
  115. file_reader.h
  116. file_reader_unittest.cc
  117. geolocation_info.cc
  118. geolocation_info.h
  119. hook_table.cc
  120. hook_table.h
  121. hook_table_unittest.cc
  122. http_request.cc
  123. http_request.h
  124. http_request_unittest.cc
  125. http_url.cc
  126. http_url.h
  127. http_url_unittest.cc
  128. icmp.cc
  129. icmp.h
  130. icmp_session.cc
  131. icmp_session.h
  132. icmp_session_factory.cc
  133. icmp_session_factory.h
  134. icmp_session_unittest.cc
  135. icmp_unittest.cc
  136. init/
  137. ip_address_store.cc
  138. ip_address_store.h
  139. ip_address_store_unittest.cc
  140. ipconfig.cc
  141. ipconfig.h
  142. ipconfig_unittest.cc
  143. json_store.cc
  144. json_store.h
  145. json_store_unittest.cc
  146. key_file_store.cc
  147. key_file_store.h
  148. key_file_store_unittest.cc
  149. key_value_store.cc
  150. key_value_store.h
  151. key_value_store_unittest.cc
  152. libshill-client-test.pc.in
  153. libshill-client.pc.in
  154. link_monitor.cc
  155. link_monitor.h
  156. link_monitor_unittest.cc
  157. logging.cc
  158. logging.h
  159. manager.cc
  160. manager.h
  161. manager_unittest.cc
  162. metrics.cc
  163. metrics.h
  164. metrics_unittest.cc
  165. mobile_operator_db/
  166. mock_active_link_monitor.cc
  167. mock_active_link_monitor.h
  168. mock_adaptors.cc
  169. mock_adaptors.h
  170. mock_ares.cc
  171. mock_ares.h
  172. mock_async_connection.cc
  173. mock_async_connection.h
  174. mock_certificate_file.cc
  175. mock_certificate_file.h
  176. mock_connection.cc
  177. mock_connection.h
  178. mock_connection_health_checker.cc
  179. mock_connection_health_checker.h
  180. mock_connection_info_reader.cc
  181. mock_connection_info_reader.h
  182. mock_connectivity_trial.cc
  183. mock_connectivity_trial.h
  184. mock_control.cc
  185. mock_control.h
  186. mock_crypto_util_proxy.cc
  187. mock_crypto_util_proxy.h
  188. mock_dbus_properties_proxy.cc
  189. mock_dbus_properties_proxy.h
  190. mock_device.cc
  191. mock_device.h
  192. mock_device_claimer.cc
  193. mock_device_claimer.h
  194. mock_device_info.cc
  195. mock_device_info.h
  196. mock_dns_client.cc
  197. mock_dns_client.h
  198. mock_dns_client_factory.cc
  199. mock_dns_client_factory.h
  200. mock_dns_server_tester.cc
  201. mock_dns_server_tester.h
  202. mock_eap_credentials.cc
  203. mock_eap_credentials.h
  204. mock_eap_listener.cc
  205. mock_eap_listener.h
  206. mock_event_dispatcher.cc
  207. mock_event_dispatcher.h
  208. mock_external_task.cc
  209. mock_external_task.h
  210. mock_file_io.h
  211. mock_http_request.cc
  212. mock_http_request.h
  213. mock_icmp.cc
  214. mock_icmp.h
  215. mock_icmp_session.cc
  216. mock_icmp_session.h
  217. mock_icmp_session_factory.cc
  218. mock_icmp_session_factory.h
  219. mock_ip_address_store.cc
  220. mock_ip_address_store.h
  221. mock_ipconfig.cc
  222. mock_ipconfig.h
  223. mock_link_monitor.cc
  224. mock_link_monitor.h
  225. mock_log.cc
  226. mock_log.h
  227. mock_log_unittest.cc
  228. mock_manager.cc
  229. mock_manager.h
  230. mock_metrics.cc
  231. mock_metrics.h
  232. mock_passive_link_monitor.cc
  233. mock_passive_link_monitor.h
  234. mock_pending_activation_store.cc
  235. mock_pending_activation_store.h
  236. mock_portal_detector.cc
  237. mock_portal_detector.h
  238. mock_power_manager.cc
  239. mock_power_manager.h
  240. mock_power_manager_proxy.cc
  241. mock_power_manager_proxy.h
  242. mock_ppp_device.cc
  243. mock_ppp_device.h
  244. mock_ppp_device_factory.cc
  245. mock_ppp_device_factory.h
  246. mock_process_manager.cc
  247. mock_process_manager.h
  248. mock_profile.cc
  249. mock_profile.h
  250. mock_property_store.cc
  251. mock_property_store.h
  252. mock_resolver.cc
  253. mock_resolver.h
  254. mock_routing_table.cc
  255. mock_routing_table.h
  256. mock_service.cc
  257. mock_service.h
  258. mock_socket_info_reader.cc
  259. mock_socket_info_reader.h
  260. mock_store.cc
  261. mock_store.h
  262. mock_throttler.cc
  263. mock_throttler.h
  264. mock_traffic_monitor.cc
  265. mock_traffic_monitor.h
  266. mock_virtual_device.cc
  267. mock_virtual_device.h
  268. net/
  269. nice_mock_control.cc
  270. nice_mock_control.h
  271. passive_link_monitor.cc
  272. passive_link_monitor.h
  273. passive_link_monitor_unittest.cc
  274. pending_activation_store.cc
  275. pending_activation_store.h
  276. pending_activation_store_unittest.cc
  277. portal_detector.cc
  278. portal_detector.h
  279. portal_detector_unittest.cc
  280. power_manager.cc
  281. power_manager.h
  282. power_manager_proxy_interface.h
  283. power_manager_unittest.cc
  284. ppp_daemon.cc
  285. ppp_daemon.h
  286. ppp_daemon_unittest.cc
  287. ppp_device.cc
  288. ppp_device.h
  289. ppp_device_factory.cc
  290. ppp_device_factory.h
  291. ppp_device_unittest.cc
  292. pppoe/
  293. process_manager.cc
  294. process_manager.h
  295. process_manager_unittest.cc
  296. profile.cc
  297. profile.h
  298. profile_unittest.cc
  299. property_accessor.h
  300. property_accessor_unittest.cc
  301. property_iterator.h
  302. property_store.cc
  303. property_store.h
  304. property_store_unittest.cc
  305. property_store_unittest.h
  306. protobuf_lite_streams.cc
  307. protobuf_lite_streams.h
  308. provider_db_unittest.bfd
  309. provider_interface.h
  310. refptr_types.h
  311. resolver.cc
  312. resolver.h
  313. resolver_unittest.cc
  314. result_aggregator.cc
  315. result_aggregator.h
  316. result_aggregator_unittest.cc
  317. routing_table.cc
  318. routing_table.h
  319. routing_table_entry.h
  320. routing_table_unittest.cc
  321. rpc_service_watcher_interface.h
  322. rpc_task.cc
  323. rpc_task.h
  324. rpc_task_unittest.cc
  325. scope_logger.cc
  326. scope_logger.h
  327. scope_logger_unittest.cc
  328. scoped_umask.cc
  329. scoped_umask.h
  330. service.cc
  331. service.h
  332. service_property_change_test.cc
  333. service_property_change_test.h
  334. service_sorter.h
  335. service_under_test.cc
  336. service_under_test.h
  337. service_unittest.cc
  338. setup_wifi/
  339. shill-client.gyp
  340. shill.gyp
  341. shill.gypi
  342. shill_ares.cc
  343. shill_ares.h
  344. shill_config.cc
  345. shill_config.h
  346. shill_daemon.cc
  347. shill_daemon.h
  348. shill_main.cc
  349. shill_test_config.cc
  350. shill_test_config.h
  351. shims/
  352. socket_info.cc
  353. socket_info.h
  354. socket_info_reader.cc
  355. socket_info_reader.h
  356. socket_info_reader_unittest.cc
  357. socket_info_unittest.cc
  358. static_ip_parameters.cc
  359. static_ip_parameters.h
  360. static_ip_parameters_unittest.cc
  361. store_interface.h
  362. stub_storage.h
  363. supplicant/
  364. technology.cc
  365. technology.h
  366. technology_unittest.cc
  367. test-scripts/
  368. test_event_dispatcher.h
  369. testing.h
  370. testrunner.cc
  371. tethering.cc
  372. tethering.h
  373. throttler.cc
  374. throttler.h
  375. throttler_unittest.cc
  376. traffic_monitor.cc
  377. traffic_monitor.h
  378. traffic_monitor_unittest.cc
  379. udev/
  380. upstart/
  381. virtual_device.cc
  382. virtual_device.h
  383. virtual_device_unittest.cc
  384. vpn/
  385. wifi/
  386. wimax/