Skip to content

Commit 70f5b90

Browse files
authored
chore(server-core): Added duration to compiling schema log (#7506)
1 parent a026ceb commit 70f5b90

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/cubejs-server-core/src/core/CompilerApi.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export class CompilerApi {
5757
}
5858

5959
if (!this.compilers || this.compilerVersion !== compilerVersion) {
60+
const startCompilingTime = new Date().getTime();
6061
try {
6162
this.logger(this.compilers ? 'Recompiling schema' : 'Compiling schema', {
6263
version: compilerVersion,
@@ -76,11 +77,13 @@ export class CompilerApi {
7677
this.logger('Compiling schema completed', {
7778
version: compilerVersion,
7879
requestId,
80+
duration: ((new Date()).getTime() - startCompilingTime),
7981
});
8082
} catch (e) {
8183
this.logger('Compiling schema error', {
8284
version: compilerVersion,
8385
requestId,
86+
duration: ((new Date()).getTime() - startCompilingTime),
8487
error: (e.stack || e).toString()
8588
});
8689
throw e;

0 commit comments

Comments
 (0)