Skip to content

Commit

Permalink
fix: Include data transformation in Load Request time
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Apr 13, 2020
1 parent 51d1214 commit edf2461
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/cubejs-api-gateway/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,17 +409,12 @@ class ApiGateway {
const response = await this.getAdapterApi({
...context, dataSource: sqlQuery.dataSource
}).executeQuery(toExecute);
this.log(context, {
type: 'Load Request Success',
query,
duration: this.duration(requestStarted)
});
const flattenAnnotation = {
...annotation.measures,
...annotation.dimensions,
...annotation.timeDimensions
};
res({
const result = {
query: normalizedQuery,
data: transformData(aliasToMemberNameMap, flattenAnnotation, response.data, normalizedQuery),
lastRefreshTime: response.lastRefreshTime && response.lastRefreshTime.toISOString(),
Expand All @@ -428,7 +423,13 @@ class ApiGateway {
usedPreAggregations: response.usedPreAggregations
}),
annotation
};
this.log(context, {
type: 'Load Request Success',
query,
duration: this.duration(requestStarted)
});
res(result);
} catch (e) {
this.handleError({
e, context, query, res, requestStarted
Expand Down

0 comments on commit edf2461

Please sign in to comment.