[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() { _runDatabaseAnalyze() {
const builder = new DatabaseSetupQueryBuilder(); const builder = new DatabaseSetupQueryBuilder();
const queries = builder.analyzeQueries(); const queries = builder.analyzeQueries();
const start = Date.now()
const step = () => { const step = () => {
const query = queries.shift(); const query = queries.shift();
if (query) { if (query) {
console.debug(DEBUG_TO_LOG, `DatabaseStore: ${query}`); console.debug(DEBUG_TO_LOG, `DatabaseStore: ${query}`);
this._executeInBackground(query, []).then(step); this._executeInBackground(query, []).then(step);
} else { } else {
console.log(`Completed ANALYZE of database`); const msec = Date.now() - start
console.log(`Completed ANALYZE of database - took ${msec}msec`);
} }
} }
step(); step();