Package android.database.sqlite
Class SQLiteDebug
- java.lang.Object
-
- android.database.sqlite.SQLiteDebug
-
public final class SQLiteDebug extends Object
Provides debugging info about all SQLite databases running in the current process.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSQLiteDebug.DbStatscontains statistics about a databasestatic classSQLiteDebug.PagerStatsContains statistics about the active pagers in the current process.
-
Field Summary
Fields Modifier and Type Field Description static booleanDEBUG_LOG_SLOW_QUERIESTrue to enable database performance testing instrumentation.static booleanDEBUG_SQL_LOGControls the printing of informational SQL log messages.static booleanDEBUG_SQL_STATEMENTSControls the printing of SQL statements as they are executed.static booleanDEBUG_SQL_TIMEControls the printing of wall-clock time taken to execute SQL statements as they are executed.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddump(Printer printer, String[] args)Dumps detailed information about all databases used by the process.static SQLiteDebug.PagerStatsgetDatabaseInfo()return all pager and database stats for the current process.static booleanshouldLogSlowQuery(long elapsedTimeMillis)Determines whether a query should be logged.
-
-
-
Field Detail
-
DEBUG_SQL_LOG
public static final boolean DEBUG_SQL_LOG
Controls the printing of informational SQL log messages. Enable using "adb shell setprop log.tag.SQLiteLog VERBOSE".
-
DEBUG_SQL_STATEMENTS
public static final boolean DEBUG_SQL_STATEMENTS
Controls the printing of SQL statements as they are executed. Enable using "adb shell setprop log.tag.SQLiteStatements VERBOSE".
-
DEBUG_SQL_TIME
public static final boolean DEBUG_SQL_TIME
Controls the printing of wall-clock time taken to execute SQL statements as they are executed. Enable using "adb shell setprop log.tag.SQLiteTime VERBOSE".
-
DEBUG_LOG_SLOW_QUERIES
public static final boolean DEBUG_LOG_SLOW_QUERIES
True to enable database performance testing instrumentation.- See Also:
- Constant Field Values
-
-
Method Detail
-
shouldLogSlowQuery
public static final boolean shouldLogSlowQuery(long elapsedTimeMillis)
Determines whether a query should be logged. Reads the "db.log.slow_query_threshold" system property, which can be changed by the user at any time. If the value is zero, then all queries will be considered slow. If the value does not exist or is negative, then no queries will be considered slow. This value can be changed dynamically while the system is running. For example, "adb shell setprop db.log.slow_query_threshold 200" will log all queries that take 200ms or longer to run.
-
getDatabaseInfo
public static SQLiteDebug.PagerStats getDatabaseInfo()
return all pager and database stats for the current process.- Returns:
SQLiteDebug.PagerStats
-
-