add to logs named maps overviews instantiation
This commit is contained in:
parent
b75150e91e
commit
880ef63720
@ -165,8 +165,12 @@ function getTemplate (
|
|||||||
params
|
params
|
||||||
);
|
);
|
||||||
|
|
||||||
mapConfigProvider.getMapConfig((err, mapConfig, rendererParams) => {
|
mapConfigProvider.getMapConfig((err, mapConfig, rendererParams, context, stats = {}) => {
|
||||||
req.profiler.done('named.getMapConfig');
|
req.profiler.done('named.getMapConfig');
|
||||||
|
|
||||||
|
stats.mapType = 'named';
|
||||||
|
req.profiler.add(stats);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ module.exports = class NamedMapMapConfigProvider extends BaseMapConfigProvider {
|
|||||||
const { user, rendererParams } = this;
|
const { user, rendererParams } = this;
|
||||||
|
|
||||||
this.mapConfigAdapter.getMapConfig(
|
this.mapConfigAdapter.getMapConfig(
|
||||||
user, requestMapConfig, rendererParams, context, (err, mapConfig) => {
|
user, requestMapConfig, rendererParams, context, (err, mapConfig, stats = {}) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
this.err = err;
|
this.err = err;
|
||||||
return callback(err);
|
return callback(err);
|
||||||
@ -108,7 +108,7 @@ module.exports = class NamedMapMapConfigProvider extends BaseMapConfigProvider {
|
|||||||
this.mapConfig = (mapConfig === null) ? null : new MapConfig(mapConfig, context.datasource);
|
this.mapConfig = (mapConfig === null) ? null : new MapConfig(mapConfig, context.datasource);
|
||||||
this.analysesResults = context.analysesResults || [];
|
this.analysesResults = context.analysesResults || [];
|
||||||
|
|
||||||
return callback(null, this.mapConfig, this.rendererParams, this.context);
|
return callback(null, this.mapConfig, this.rendererParams, this.context, stats);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -119,6 +119,11 @@ describe('overviews metadata for named maps', function() {
|
|||||||
assert.ok(parsedBody.layergroupid);
|
assert.ok(parsedBody.layergroupid);
|
||||||
assert.ok(parsedBody.last_updated);
|
assert.ok(parsedBody.last_updated);
|
||||||
|
|
||||||
|
const headers = JSON.parse(res.headers['x-tiler-profiler']);
|
||||||
|
|
||||||
|
assert.ok(headers.overviewsAddedToMapconfig);
|
||||||
|
assert.equal(headers.mapType, 'named');
|
||||||
|
|
||||||
next(null, parsedBody.layergroupid);
|
next(null, parsedBody.layergroupid);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user