Commit 7722ddf9 authored by hirono's avatar hirono Committed by Commit bot

Revert "Files.app: Add UMA for HardUnplugged events."

We no longer need these UMA.
This reverts commit 7f60d255.

BUG=433734
TEST=None

Review URL: https://codereview.chromium.org/888083004

Cr-Commit-Position: refs/heads/master@{#314968}
parent 9ba5a272
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "base/bind.h" #include "base/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/thread_task_runner_handle.h" #include "base/thread_task_runner_handle.h"
#include "chrome/browser/chromeos/extensions/file_manager/device_event_router.h" #include "chrome/browser/chromeos/extensions/file_manager/device_event_router.h"
#include "chrome/browser/chromeos/file_manager/volume_manager.h" #include "chrome/browser/chromeos/file_manager/volume_manager.h"
...@@ -81,13 +80,6 @@ void DeviceEventRouter::OnDiskRemoved( ...@@ -81,13 +80,6 @@ void DeviceEventRouter::OnDiskRemoved(
const std::string& device_path = disk.system_path_prefix(); const std::string& device_path = disk.system_path_prefix();
if (!disk.mount_path().empty() && if (!disk.mount_path().empty() &&
GetDeviceState(device_path) != DEVICE_HARD_UNPLUGGED_AND_REPORTED) { GetDeviceState(device_path) != DEVICE_HARD_UNPLUGGED_AND_REPORTED) {
// TODO(hirono): Remove the temporary UMA. crbug.com/433734
if (!last_suspend_done_.is_null()) {
UMA_HISTOGRAM_MEDIUM_TIMES(
"FileBrowser.HardUnpluggedAroundSuspend.TimeSinceResume",
base::Time::Now() - last_suspend_done_);
}
last_hard_unplugged_ = base::Time::Now();
OnDeviceEvent(file_manager_private::DEVICE_EVENT_TYPE_HARD_UNPLUGGED, OnDeviceEvent(file_manager_private::DEVICE_EVENT_TYPE_HARD_UNPLUGGED,
device_path); device_path);
SetDeviceState(device_path, DEVICE_HARD_UNPLUGGED_AND_REPORTED); SetDeviceState(device_path, DEVICE_HARD_UNPLUGGED_AND_REPORTED);
...@@ -132,18 +124,11 @@ void DeviceEventRouter::OnFormatCompleted(const std::string& device_path, ...@@ -132,18 +124,11 @@ void DeviceEventRouter::OnFormatCompleted(const std::string& device_path,
void DeviceEventRouter::SuspendImminent() { void DeviceEventRouter::SuspendImminent() {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
// TODO(hirono): Remove the temporary UMA. crbug.com/433734
if (!last_hard_unplugged_.is_null()) {
UMA_HISTOGRAM_MEDIUM_TIMES(
"FileBrowser.HardUnpluggedAroundSuspend.TimeUntilSuspend",
base::Time::Now() - last_hard_unplugged_);
}
is_resuming_ = true; is_resuming_ = true;
} }
void DeviceEventRouter::SuspendDone(const base::TimeDelta& sleep_duration) { void DeviceEventRouter::SuspendDone(const base::TimeDelta& sleep_duration) {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
last_suspend_done_ = base::Time::Now();
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, FROM_HERE,
base::Bind(&DeviceEventRouter::SuspendDoneDelayed, base::Bind(&DeviceEventRouter::SuspendDoneDelayed,
......
...@@ -96,11 +96,6 @@ class DeviceEventRouter : public VolumeManagerObserver, ...@@ -96,11 +96,6 @@ class DeviceEventRouter : public VolumeManagerObserver,
// Thread checker. // Thread checker.
base::ThreadChecker thread_checker_; base::ThreadChecker thread_checker_;
// Last event time for UMA.
// TODO(hirono): Remove the temporarily UMA. crbug.com/433734
base::Time last_hard_unplugged_;
base::Time last_suspend_done_;
// Note: This should remain the last member so it'll be destroyed and // Note: This should remain the last member so it'll be destroyed and
// invalidate the weak pointers before any other members are destroyed. // invalidate the weak pointers before any other members are destroyed.
base::WeakPtrFactory<DeviceEventRouter> weak_factory_; base::WeakPtrFactory<DeviceEventRouter> weak_factory_;
......
...@@ -9509,6 +9509,9 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -9509,6 +9509,9 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<histogram name="FileBrowser.HardUnpluggedAroundSuspend.TimeSinceResume" <histogram name="FileBrowser.HardUnpluggedAroundSuspend.TimeSinceResume"
units="milliseconds"> units="milliseconds">
<obsolete>
The bug which the UMA was investigating got fixed.
</obsolete>
<owner>hirono@chromium.org</owner> <owner>hirono@chromium.org</owner>
<summary> <summary>
Chrome OS File Browser: time from the SuspendDone event to the DiskRemoved Chrome OS File Browser: time from the SuspendDone event to the DiskRemoved
...@@ -9518,6 +9521,9 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -9518,6 +9521,9 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<histogram name="FileBrowser.HardUnpluggedAroundSuspend.TimeUntilSuspend" <histogram name="FileBrowser.HardUnpluggedAroundSuspend.TimeUntilSuspend"
units="milliseconds"> units="milliseconds">
<obsolete>
The bug which the UMA was investigating got fixed.
</obsolete>
<owner>hirono@chromium.org</owner> <owner>hirono@chromium.org</owner>
<summary> <summary>
Chrome OS File Browser: time from the DiskRemoved event to the Suspend Chrome OS File Browser: time from the DiskRemoved event to the Suspend
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment