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

Unified Diff: sql/connection.cc

Issue 1316493006: [sql] Record SQLite memory usage after a week. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« 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: sql/connection.cc
diff --git a/sql/connection.cc b/sql/connection.cc
index 2fcc9da10f269573813191a2eaadb5b046cfcf4f..3f37b90cc71fd059b4eef51ad6a79d47608a1b4b 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -128,6 +128,11 @@ void RecordSqliteMemoryDay() {
UMA_HISTOGRAM_COUNTS("Sqlite.MemoryKB.OneDay", used / 1024);
}
+void RecordSqliteMemoryWeek() {
+ const int64 used = sqlite3_memory_used();
+ UMA_HISTOGRAM_COUNTS("Sqlite.MemoryKB.OneWeek", used / 1024);
+}
+
// SQLite automatically calls sqlite3_initialize() lazily, but
// sqlite3_initialize() uses double-checked locking and thus can have
// data races.
@@ -155,6 +160,9 @@ void InitializeSqlite() {
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE, base::Bind(&RecordSqliteMemoryDay),
base::TimeDelta::FromDays(1));
+ base::MessageLoop::current()->PostDelayedTask(
+ FROM_HERE, base::Bind(&RecordSqliteMemoryWeek),
+ base::TimeDelta::FromDays(7));
}
first_call = false;
« 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