Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.cc

Issue 269343008: [SyncFS] Add a UMA to measure RTT in registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change summary description of UMA Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_backend/sync_engine.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
index 82a03c753eac88eef7a8134e0945c31b5b5b0d86..1f19fb64872982b5242682ee544b617c49b825ea 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
@@ -7,7 +7,9 @@
#include <vector>
#include "base/bind.h"
+#include "base/metrics/histogram.h"
#include "base/threading/sequenced_worker_pool.h"
+#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/drive/drive_api_service.h"
#include "chrome/browser/drive/drive_notification_manager.h"
@@ -102,6 +104,14 @@ namespace {
void EmptyStatusCallback(SyncStatusCode status) {}
+void DidRegisterOrigin(const base::TimeTicks& start_time,
+ const SyncStatusCallback& callback,
+ SyncStatusCode status) {
+ base::TimeDelta delta(base::TimeTicks::Now() - start_time);
+ HISTOGRAM_TIMES("SyncFileSystem.RegisterOriginTime", delta);
+ callback.Run(status);
+}
+
} // namespace
scoped_ptr<SyncEngine> SyncEngine::CreateForBrowserContext(
@@ -227,7 +237,10 @@ void SyncEngine::RegisterOrigin(
base::Unretained(sync_worker_.get()),
origin,
RelayCallbackToCurrentThread(
- FROM_HERE, callback)));
+ FROM_HERE,
+ base::Bind(&DidRegisterOrigin,
+ base::TimeTicks::Now(),
+ callback))));
}
void SyncEngine::EnableOrigin(
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698