Record formatting time and error to UMA

Formatting time is calculated by storing a map of device_path -> start
time, which is updated when the format command is called. There are
weird cases that could happen, e.g. chrome not receiving the
FormatCompleted signal, but since the start time is overwritten when
format is called, these rare cases should not be an issue.

Bug: 632988
Change-Id: Ida2f7ddf192424220ca77c32f0c3fbf8b96a3fec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1705198
Reviewed-by: Jesse Doherty <jwd@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Anand Mistry <amistry@chromium.org>
Commit-Queue: Austin Tankiang <austinct@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679495}
4 files changed