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

Unified Diff: content/browser/indexed_db/indexed_db_callbacks.cc

Issue 470373002: IndexedDB: Measure the total database open time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: conn_open_start_time_ -> connection_open_start_time_ Created 6 years, 4 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
Index: content/browser/indexed_db/indexed_db_callbacks.cc
diff --git a/content/browser/indexed_db/indexed_db_callbacks.cc b/content/browser/indexed_db/indexed_db_callbacks.cc
index cee89b1fb75b9875062a21a3646913e424f57b2a..4d319f96c377471f1bc26acb841d95d2ac377cff 100644
--- a/content/browser/indexed_db/indexed_db_callbacks.cc
+++ b/content/browser/indexed_db/indexed_db_callbacks.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/guid.h"
+#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "content/browser/child_process_security_policy_impl.h"
@@ -91,6 +92,13 @@ void IndexedDBCallbacks::OnError(const IndexedDBDatabaseError& error) {
dispatcher_host_->Send(new IndexedDBMsg_CallbacksError(
ipc_thread_id_, ipc_callbacks_id_, error.code(), error.message()));
dispatcher_host_ = NULL;
+
+ if (!connection_open_start_time_.is_null()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "WebCore.IndexedDB.OpenTime.Error",
+ base::TimeTicks::Now() - connection_open_start_time_);
+ connection_open_start_time_ = base::TimeTicks();
+ }
}
void IndexedDBCallbacks::OnSuccess(const std::vector<base::string16>& value) {
@@ -126,6 +134,13 @@ void IndexedDBCallbacks::OnBlocked(int64 existing_version) {
sent_blocked_ = true;
dispatcher_host_->Send(new IndexedDBMsg_CallbacksIntBlocked(
ipc_thread_id_, ipc_callbacks_id_, existing_version));
+
+ if (!connection_open_start_time_.is_null()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "WebCore.IndexedDB.OpenTime.Blocked",
+ base::TimeTicks::Now() - connection_open_start_time_);
+ connection_open_start_time_ = base::TimeTicks();
+ }
}
void IndexedDBCallbacks::OnDataLoss(blink::WebIDBDataLoss data_loss,
@@ -162,6 +177,13 @@ void IndexedDBCallbacks::OnUpgradeNeeded(
params.data_loss = data_loss_;
params.data_loss_message = data_loss_message_;
dispatcher_host_->Send(new IndexedDBMsg_CallbacksUpgradeNeeded(params));
+
+ if (!connection_open_start_time_.is_null()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "WebCore.IndexedDB.OpenTime.UpgradeNeeded",
+ base::TimeTicks::Now() - connection_open_start_time_);
+ connection_open_start_time_ = base::TimeTicks();
+ }
}
void IndexedDBCallbacks::OnSuccess(scoped_ptr<IndexedDBConnection> connection,
@@ -189,6 +211,13 @@ void IndexedDBCallbacks::OnSuccess(scoped_ptr<IndexedDBConnection> connection,
ipc_object_id,
IndexedDBDispatcherHost::ConvertMetadata(metadata)));
dispatcher_host_ = NULL;
+
+ if (!connection_open_start_time_.is_null()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "WebCore.IndexedDB.OpenTime.Success",
+ base::TimeTicks::Now() - connection_open_start_time_);
+ connection_open_start_time_ = base::TimeTicks();
+ }
}
static std::string CreateBlobData(
@@ -579,4 +608,9 @@ void IndexedDBCallbacks::OnSuccess() {
dispatcher_host_ = NULL;
}
+void IndexedDBCallbacks::SetConnectionOpenStartTime(
+ const base::TimeTicks& start_time) {
+ connection_open_start_time_ = start_time;
+}
+
} // namespace content
« no previous file with comments | « content/browser/indexed_db/indexed_db_callbacks.h ('k') | content/browser/indexed_db/indexed_db_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698