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

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

Issue 2904603003: [IndexedDB] Adding txn, value, and key size metrics (Closed)
Patch Set: made sure size is 0'd out Created 3 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
Index: content/browser/indexed_db/indexed_db_transaction.cc
diff --git a/content/browser/indexed_db/indexed_db_transaction.cc b/content/browser/indexed_db/indexed_db_transaction.cc
index 5fe8767263d41b14e068827d163a39eb32e1d5d1..e1a3a5b373e56fce0caf8ec2589b477ca71c9e32 100644
--- a/content/browser/indexed_db/indexed_db_transaction.cc
+++ b/content/browser/indexed_db/indexed_db_transaction.cc
@@ -381,6 +381,32 @@ leveldb::Status IndexedDBTransaction::CommitPhaseTwo() {
if (!used_) {
committed = true;
} else {
+ base::TimeDelta active_time = base::Time::Now() - diagnostics_.start_time;
+ uint64_t size = transaction_->GetTransactionSize() / 1024;
+ switch (mode_) {
+ case blink::kWebIDBTransactionModeReadOnly:
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "WebCore.IndexedDB.Transaction.ReadOnly.TimeActive", active_time);
+ UMA_HISTOGRAM_MEMORY_KB(
+ "WebCore.IndexedDB.Transaction.ReadOnly.SizeOnCommit", size);
+ break;
+ case blink::kWebIDBTransactionModeReadWrite:
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "WebCore.IndexedDB.Transaction.ReadWrite.TimeActive", active_time);
+ UMA_HISTOGRAM_MEMORY_KB(
+ "WebCore.IndexedDB.Transaction.ReadWrite.SizeOnCommit", size);
+ break;
+ case blink::kWebIDBTransactionModeVersionChange:
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "WebCore.IndexedDB.Transaction.VersionChange.TimeActive",
+ active_time);
+ UMA_HISTOGRAM_MEMORY_KB(
+ "WebCore.IndexedDB.Transaction.VersionChange.SizeOnCommit", size);
+ break;
+ default:
+ NOTREACHED();
+ }
+
s = transaction_->CommitPhaseTwo();
committed = s.ok();
}
« no previous file with comments | « content/browser/indexed_db/indexed_db_fake_backing_store.cc ('k') | content/browser/indexed_db/leveldb/leveldb_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698