Skip to content

Commit

Permalink
Record filesystem selected when formatting to UMA
Browse files Browse the repository at this point in the history
Bug: 632988
Change-Id: Ia4c1b0020958ba8e4243f4797945fc05d2c89400
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1706457
Reviewed-by: Steven Holte <holte@chromium.org>
Reviewed-by: Anand Mistry <amistry@chromium.org>
Commit-Queue: Austin Tankiang <austinct@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679847}
  • Loading branch information
Austin Tankiang authored and Commit Bot committed Jul 23, 2019
1 parent 53c8f4a commit a111d00
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chromeos/disks/disk_mount_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/observer_list.h"
#include "base/strings/string_util.h"
#include "chromeos/constants/chromeos_features.h"
Expand Down Expand Up @@ -555,6 +556,9 @@ class DiskMountManagerImpl : public DiskMountManager,
DiskMap::const_iterator disk = disks_.find(device_path);
DCHECK(disk != disks_.end() && disk->second->mount_path().empty());

base::UmaHistogramEnumeration("FileBrowser.FormatFileSystemType",
filesystem);

const std::string filesystem_str = FormatFileSystemTypeToString(filesystem);
pending_format_changes_[device_path] = {filesystem_str, label};

Expand Down
3 changes: 3 additions & 0 deletions chromeos/disks/disk_mount_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ enum MountCondition {
};

// Possible filesystem types that can be passed to FormatMountedDevice.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class FormatFileSystemType {
kUnknown = 0,
kVfat = 1,
kExfat = 2,
kNtfs = 3,
kMaxValue = kNtfs,
};

// This class handles the interaction with cros-disks.
Expand Down
7 changes: 7 additions & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25025,6 +25025,13 @@ Called by update_net_error_codes.py.-->
<int value="2" label="Unable to open"/>
</enum>

<enum name="FileManagerFormatFileSystemType">
<int value="0" label="Unknown"/>
<int value="1" label="FAT32"/>
<int value="2" label="exFAT"/>
<int value="3" label="NTFS"/>
</enum>

<enum name="FileManagerListType">
<int value="0" label="Uninitialized"/>
<int value="1" label="List view (detail)"/>
Expand Down
9 changes: 9 additions & 0 deletions tools/metrics/histograms/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43964,6 +43964,15 @@ uploading your change for review.
</summary>
</histogram>

<histogram name="FileBrowser.FormatFileSystemType"
enum="FileManagerFormatFileSystemType" expires_after="2019-12-06">
<owner>austinct@chromium.org</owner>
<summary>
Chrome OS File Browser: this records the filesystem selected when formatting
an external drive.
</summary>
</histogram>

<histogram name="FileBrowser.HardUnpluggedAroundSuspend.TimeSinceResume"
units="ms" expires_after="M79">
<obsolete>
Expand Down

0 comments on commit a111d00

Please sign in to comment.