Measure access performance to Android SQLite database

0

Good afternoon,

How can I measure performance of access to SQLite database of Android? More specifically insertion and selection in the bank.

    
asked by anonymous 03.11.2015 / 20:37

1 answer

0

You can create mocks (sample data for input or output) in the SQLite database and in the App.

I suppose you're already using Android's best performance pattern , so every time you start a request you can enter a LOG and the listener that receives the result you put another LOG indicating the end of the SQL execution.

Example, if you are using AsyncTask

private class SQLTask extends AsyncTask<URL, Integer, Long> {

 protected Long doInBackground(URL... urls) {
     Log.e(TAG,"inicio");
     //sua consulta SQL
     return totalSize;
 }


 protected void onPostExecute(Long result) {
     Log.e(TAG,"fim");

 }
}

With this you will know how long a SQL command is running, you can also monitor using Android Studio in the Android Monitor tab and memory of the application.

Anyway, there are other N methods to do this, it will all depend on how detailed you want this monitoring

    
04.11.2015 / 22:42