[client-app] Log duration of db ANALYZE query

Summary: See title

Test Plan: manual

Reviewers: mark, halla, evan

Reviewed By: halla, evan

Differential Revision: https://phab.nylas.com/D4290
This commit is contained in:
Juan Tejada 2017-03-29 12:23:40 -07:00
parent ec51e982eb
commit caac7cd247

View file

@ -223,13 +223,15 @@ class DatabaseStore extends NylasStore {
_runDatabaseAnalyze() {
const builder = new DatabaseSetupQueryBuilder();
const queries = builder.analyzeQueries();
const start = Date.now()
const step = () => {
const query = queries.shift();
if (query) {
console.debug(DEBUG_TO_LOG, `DatabaseStore: ${query}`);
this._executeInBackground(query, []).then(step);
} else {
console.log(`Completed ANALYZE of database`);
const msec = Date.now() - start
console.log(`Completed ANALYZE of database - took ${msec}msec`);
}
}
step();