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
const stats = {};
if (flags && flags.usesOverviews) {
stats.usesOverviews = true;
if (this.getType) {
stats.dataviewType = this.getType();
}
if (flags && flags.usesOverviews !== undefined) {
stats.usesOverviews = flags.usesOverviews;
} else {
stats.usesOverviews = false;
}
if (this.getType) {
stats.dataviewType = this.getType();
}
return callback(null, result, stats);
}, true); // use read-only transaction
});

View File

@ -53,7 +53,7 @@ describe('dataviews using tables without overviews', function() {
return done(err);
}
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);
});