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

Unified Diff: base/prefs/json_pref_store.cc

Issue 149073003: Add a Settings.FilterOnLoadTime histogram to observe time spent on this critical path in the wild. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removal date Created 6 years, 11 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: base/prefs/json_pref_store.cc
diff --git a/base/prefs/json_pref_store.cc b/base/prefs/json_pref_store.cc
index 0703075846fd59f95344060ecf8d6aafa60d8911..29030423341ea20a70b6a1ff655a36cb72559732 100644
--- a/base/prefs/json_pref_store.cc
+++ b/base/prefs/json_pref_store.cc
@@ -13,9 +13,11 @@
#include "base/json/json_string_value_serializer.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "base/metrics/histogram.h"
#include "base/prefs/pref_filter.h"
#include "base/sequenced_task_runner.h"
#include "base/threading/sequenced_worker_pool.h"
+#include "base/time/time.h"
#include "base/values.h"
namespace {
@@ -314,8 +316,15 @@ void JsonPrefStore::OnFileRead(base::Value* value_owned,
NOTREACHED() << "Unknown error: " << error;
}
- if (pref_filter_)
+ if (pref_filter_) {
+ // TODO(gab): Remove this histogram by Feb 21 2014; after sufficient timing
+ // data has been gathered from the wild to be confident this doesn't
+ // significantly affect startup.
+ base::TimeTicks checkpoint = base::TimeTicks::Now();
pref_filter_->FilterOnLoad(prefs_.get());
+ UMA_HISTOGRAM_TIMES("Settings.FilterOnLoadTime",
+ base::TimeTicks::Now() - checkpoint);
+ }
if (error_delegate_.get() && error != PREF_READ_ERROR_NONE)
error_delegate_->OnError(error);
@@ -330,8 +339,15 @@ JsonPrefStore::~JsonPrefStore() {
}
bool JsonPrefStore::SerializeData(std::string* output) {
- if (pref_filter_)
+ if (pref_filter_) {
+ // TODO(gab): Remove this histogram by Feb 21 2014; after sufficient timing
+ // data has been gathered from the wild to be confident this doesn't
+ // significantly affect performance on the UI thread.
+ base::TimeTicks checkpoint = base::TimeTicks::Now();
pref_filter_->FilterSerializeData(prefs_.get());
+ UMA_HISTOGRAM_TIMES("Settings.FilterSerializeDataTime",
+ base::TimeTicks::Now() - checkpoint);
+ }
JSONStringValueSerializer serializer(output);
serializer.set_pretty_print(true);
« 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