Commit dd7d41f8 authored by Anand K. Mistry's avatar Anand K. Mistry Committed by Commit Bot

Add UMA for tracking Mount/Unmount times.

BUG=873903

Change-Id: I61394811e9264a2ea22cedacd7c782bbc4051bf9
Reviewed-on: https://chromium-review.googlesource.com/1233055Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Commit-Queue: Anand Mistry <amistry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593473}
parent 6c9a8f54
......@@ -23,6 +23,7 @@
#include "base/strings/stringprintf.h"
#include "base/sys_info.h"
#include "base/task_runner_util.h"
#include "base/time/time.h"
#include "base/values.h"
#include "chromeos/dbus/fake_cros_disks_client.h"
#include "dbus/bus.h"
......@@ -170,10 +171,10 @@ class CrosDisksClientImpl : public CrosDisksClient {
std::vector<std::string> options =
ComposeMountOptions(mount_options, mount_label, access_mode, remount);
writer.AppendArrayOfStrings(options);
proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&CrosDisksClientImpl::OnVoidMethod,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&CrosDisksClientImpl::OnMount,
weak_ptr_factory_.GetWeakPtr(),
std::move(callback), base::Time::Now()));
}
// CrosDisksClient override.
......@@ -190,10 +191,10 @@ class CrosDisksClientImpl : public CrosDisksClient {
unmount_options.push_back(kLazyUnmountOption);
writer.AppendArrayOfStrings(unmount_options);
proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&CrosDisksClientImpl::OnUnmount,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&CrosDisksClientImpl::OnUnmount,
weak_ptr_factory_.GetWeakPtr(),
std::move(callback), base::Time::Now()));
}
void EnumerateDevices(EnumerateDevicesCallback callback,
......@@ -326,10 +327,23 @@ class CrosDisksClientImpl : public CrosDisksClient {
std::move(callback).Run(response);
}
// Handles the result of Mount and calls |callback|.
void OnMount(VoidDBusMethodCallback callback,
base::Time start_time,
dbus::Response* response) {
UMA_HISTOGRAM_MEDIUM_TIMES("CrosDisksClient.MountTime",
base::Time::Now() - start_time);
std::move(callback).Run(response);
}
// Handles the result of Unmount and calls |callback| or |error_callback|.
void OnUnmount(UnmountCallback callback, dbus::Response* response) {
const char kUnmountHistogramName[] = "CrosDisksClient.UnmountError";
void OnUnmount(UnmountCallback callback,
base::Time start_time,
dbus::Response* response) {
UMA_HISTOGRAM_MEDIUM_TIMES("CrosDisksClient.UnmountTime",
base::Time::Now() - start_time);
const char kUnmountHistogramName[] = "CrosDisksClient.UnmountError";
if (!response) {
UMA_HISTOGRAM_ENUMERATION(kUnmountHistogramName, MOUNT_ERROR_UNKNOWN,
MOUNT_ERROR_COUNT);
......
......@@ -15654,6 +15654,13 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="CrosDisksClient.MountTime" units="ms">
<owner>amistry@chromium.org</owner>
<summary>
Time taken by the Chrome OS cros-disks daemon to perform a Mount operation.
</summary>
</histogram>
<histogram name="CrosDisksClient.UnmountError" enum="CrosDisksClientMountError">
<owner>amistry@chromium.org</owner>
<summary>
......@@ -15662,6 +15669,14 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="CrosDisksClient.UnmountTime" units="ms">
<owner>amistry@chromium.org</owner>
<summary>
Time taken by the Chrome OS cros-disks daemon to perform an Unmount
operation.
</summary>
</histogram>
<histogram name="CrosFirstRun.DialogShown">
<owner>alemate@chromium.org</owner>
<summary>
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