Skip to content

Commit edf2461

Browse files
committed
fix: Include data transformation in Load Request time
1 parent 51d1214 commit edf2461

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/cubejs-api-gateway/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,17 +409,12 @@ class ApiGateway {
409409
const response = await this.getAdapterApi({
410410
...context, dataSource: sqlQuery.dataSource
411411
}).executeQuery(toExecute);
412-
this.log(context, {
413-
type: 'Load Request Success',
414-
query,
415-
duration: this.duration(requestStarted)
416-
});
417412
const flattenAnnotation = {
418413
...annotation.measures,
419414
...annotation.dimensions,
420415
...annotation.timeDimensions
421416
};
422-
res({
417+
const result = {
423418
query: normalizedQuery,
424419
data: transformData(aliasToMemberNameMap, flattenAnnotation, response.data, normalizedQuery),
425420
lastRefreshTime: response.lastRefreshTime && response.lastRefreshTime.toISOString(),
@@ -428,7 +423,13 @@ class ApiGateway {
428423
usedPreAggregations: response.usedPreAggregations
429424
}),
430425
annotation
426+
};
427+
this.log(context, {
428+
type: 'Load Request Success',
429+
query,
430+
duration: this.duration(requestStarted)
431431
});
432+
res(result);
432433
} catch (e) {
433434
this.handleError({
434435
e, context, query, res, requestStarted

0 commit comments

Comments
 (0)