add to logs even if no overviews tables were used.

{usesOverviews:false}
This commit is contained in:
Eneko Lakasta 2018-08-30 14:52:37 +02:00
parent 7c52f504e5
commit 95d179835c
2 changed files with 10 additions and 7 deletions

View File

@ -37,13 +37,16 @@ module.exports = class BaseDataview {
//Overviews logging //Overviews logging
const stats = {}; const stats = {};
if (flags && flags.usesOverviews) { if (flags && flags.usesOverviews !== undefined) {
stats.usesOverviews = true; stats.usesOverviews = flags.usesOverviews;
if (this.getType) { } else {
stats.dataviewType = this.getType(); stats.usesOverviews = false;
}
} }
if (this.getType) {
stats.dataviewType = this.getType();
}
return callback(null, result, stats); return callback(null, result, stats);
}, true); // use read-only transaction }, true); // use read-only transaction
}); });

View File

@ -53,7 +53,7 @@ describe('dataviews using tables without overviews', function() {
return done(err); return done(err);
} }
assert.deepEqual(formula_result, { operation: 'count', result: 7313, nulls: 0, type: 'formula' }); assert.deepEqual(formula_result, { operation: 'count', result: 7313, nulls: 0, type: 'formula' });
assert(getUsesOverviewsFromHeaders(headers) === undefined); //Overviews logging assert(getUsesOverviewsFromHeaders(headers) === false); //Overviews logging
testClient.drain(done); testClient.drain(done);
}); });