Clean logs from console.time (#9620)
As title. We do not need those anymore.
This commit is contained in:
@ -104,7 +104,6 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
|||||||
FieldMetadataEntity,
|
FieldMetadataEntity,
|
||||||
);
|
);
|
||||||
|
|
||||||
console.time('createOne query');
|
|
||||||
const [objectMetadata] = await this.objectMetadataRepository.find({
|
const [objectMetadata] = await this.objectMetadataRepository.find({
|
||||||
where: {
|
where: {
|
||||||
id: fieldMetadataInput.objectMetadataId,
|
id: fieldMetadataInput.objectMetadataId,
|
||||||
@ -114,8 +113,6 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
|||||||
order: {},
|
order: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.timeEnd('createOne query');
|
|
||||||
|
|
||||||
if (!objectMetadata) {
|
if (!objectMetadata) {
|
||||||
throw new FieldMetadataException(
|
throw new FieldMetadataException(
|
||||||
'Object metadata does not exist',
|
'Object metadata does not exist',
|
||||||
@ -181,15 +178,11 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.time('createOne save');
|
|
||||||
const createdFieldMetadata = await fieldMetadataRepository.save(
|
const createdFieldMetadata = await fieldMetadataRepository.save(
|
||||||
fieldMetadataForCreate,
|
fieldMetadataForCreate,
|
||||||
);
|
);
|
||||||
|
|
||||||
console.timeEnd('createOne save');
|
|
||||||
|
|
||||||
if (!fieldMetadataInput.isRemoteCreation) {
|
if (!fieldMetadataInput.isRemoteCreation) {
|
||||||
console.time('createOne migration create');
|
|
||||||
await this.workspaceMigrationService.createCustomMigration(
|
await this.workspaceMigrationService.createCustomMigration(
|
||||||
generateMigrationName(`create-${createdFieldMetadata.name}`),
|
generateMigrationName(`create-${createdFieldMetadata.name}`),
|
||||||
fieldMetadataInput.workspaceId,
|
fieldMetadataInput.workspaceId,
|
||||||
@ -205,16 +198,11 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
console.timeEnd('createOne migration create');
|
|
||||||
|
|
||||||
console.time('createOne migration run');
|
|
||||||
await this.workspaceMigrationRunnerService.executeMigrationFromPendingMigrations(
|
await this.workspaceMigrationRunnerService.executeMigrationFromPendingMigrations(
|
||||||
fieldMetadataInput.workspaceId,
|
fieldMetadataInput.workspaceId,
|
||||||
);
|
);
|
||||||
console.timeEnd('createOne migration run');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.time('createOne workspace viewField');
|
|
||||||
// TODO: Move viewField creation to a cdc scheduler
|
// TODO: Move viewField creation to a cdc scheduler
|
||||||
const dataSourceMetadata =
|
const dataSourceMetadata =
|
||||||
await this.dataSourceService.getLastDataSourceMetadataFromWorkspaceIdOrFail(
|
await this.dataSourceService.getLastDataSourceMetadataFromWorkspaceIdOrFail(
|
||||||
@ -274,11 +262,7 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.timeEnd('createOne workspace viewField');
|
|
||||||
|
|
||||||
console.time('createOne internal commit');
|
|
||||||
await workspaceQueryRunner.commitTransaction();
|
await workspaceQueryRunner.commitTransaction();
|
||||||
console.timeEnd('createOne internal commit');
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await workspaceQueryRunner.rollbackTransaction();
|
await workspaceQueryRunner.rollbackTransaction();
|
||||||
throw error;
|
throw error;
|
||||||
@ -286,9 +270,7 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
|||||||
await workspaceQueryRunner.release();
|
await workspaceQueryRunner.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.time('createOne commit');
|
|
||||||
await queryRunner.commitTransaction();
|
await queryRunner.commitTransaction();
|
||||||
console.timeEnd('createOne commit');
|
|
||||||
|
|
||||||
return createdFieldMetadata;
|
return createdFieldMetadata;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -296,12 +278,9 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
|||||||
throw error;
|
throw error;
|
||||||
} finally {
|
} finally {
|
||||||
await queryRunner.release();
|
await queryRunner.release();
|
||||||
console.time('createOne increment');
|
|
||||||
await this.workspaceMetadataVersionService.incrementMetadataVersion(
|
await this.workspaceMetadataVersionService.incrementMetadataVersion(
|
||||||
fieldMetadataInput.workspaceId,
|
fieldMetadataInput.workspaceId,
|
||||||
);
|
);
|
||||||
console.timeEnd('createOne increment');
|
|
||||||
console.timeEnd('createOne');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { InjectRepository } from '@nestjs/typeorm';
|
import { InjectRepository } from '@nestjs/typeorm';
|
||||||
|
|
||||||
import console from 'console';
|
|
||||||
|
|
||||||
import { Repository } from 'typeorm';
|
import { Repository } from 'typeorm';
|
||||||
|
|
||||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||||
@ -72,7 +70,6 @@ export class WorkspaceMetadataCacheService {
|
|||||||
currentDatabaseVersion,
|
currentDatabaseVersion,
|
||||||
);
|
);
|
||||||
|
|
||||||
console.time('fetching object metadata');
|
|
||||||
const objectMetadataItems = await this.objectMetadataRepository.find({
|
const objectMetadataItems = await this.objectMetadataRepository.find({
|
||||||
where: { workspaceId },
|
where: { workspaceId },
|
||||||
relations: [
|
relations: [
|
||||||
@ -84,14 +81,9 @@ export class WorkspaceMetadataCacheService {
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
console.timeEnd('fetching object metadata');
|
|
||||||
|
|
||||||
console.time('generating object metadata map');
|
|
||||||
const freshObjectMetadataMaps =
|
const freshObjectMetadataMaps =
|
||||||
generateObjectMetadataMaps(objectMetadataItems);
|
generateObjectMetadataMaps(objectMetadataItems);
|
||||||
|
|
||||||
console.timeEnd('generating object metadata map');
|
|
||||||
|
|
||||||
await this.workspaceCacheStorageService.setObjectMetadataMaps(
|
await this.workspaceCacheStorageService.setObjectMetadataMaps(
|
||||||
workspaceId,
|
workspaceId,
|
||||||
currentDatabaseVersion,
|
currentDatabaseVersion,
|
||||||
|
|||||||
@ -41,8 +41,6 @@ export class CalendarEventListFetchCronJob {
|
|||||||
CALENDAR_EVENT_LIST_FETCH_CRON_PATTERN,
|
CALENDAR_EVENT_LIST_FETCH_CRON_PATTERN,
|
||||||
)
|
)
|
||||||
async handle(): Promise<void> {
|
async handle(): Promise<void> {
|
||||||
console.time('CalendarEventListFetchCronJob time');
|
|
||||||
|
|
||||||
const activeWorkspaces = await this.workspaceRepository.find({
|
const activeWorkspaces = await this.workspaceRepository.find({
|
||||||
where: {
|
where: {
|
||||||
activationStatus: WorkspaceActivationStatus.ACTIVE,
|
activationStatus: WorkspaceActivationStatus.ACTIVE,
|
||||||
@ -84,7 +82,5 @@ export class CalendarEventListFetchCronJob {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.timeEnd('CalendarEventListFetchCronJob time');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,8 +39,6 @@ export class CalendarEventsImportCronJob {
|
|||||||
CALENDAR_EVENTS_IMPORT_CRON_PATTERN,
|
CALENDAR_EVENTS_IMPORT_CRON_PATTERN,
|
||||||
)
|
)
|
||||||
async handle(): Promise<void> {
|
async handle(): Promise<void> {
|
||||||
console.time('CalendarEventsImportCronJob time');
|
|
||||||
|
|
||||||
const activeWorkspaces = await this.workspaceRepository.find({
|
const activeWorkspaces = await this.workspaceRepository.find({
|
||||||
where: {
|
where: {
|
||||||
activationStatus: WorkspaceActivationStatus.ACTIVE,
|
activationStatus: WorkspaceActivationStatus.ACTIVE,
|
||||||
@ -81,7 +79,5 @@ export class CalendarEventsImportCronJob {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.timeEnd('CalendarEventsImportCronJob time');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,8 +28,6 @@ export class CalendarEventListFetchJob {
|
|||||||
|
|
||||||
@Process(CalendarEventListFetchJob.name)
|
@Process(CalendarEventListFetchJob.name)
|
||||||
async handle(data: CalendarEventListFetchJobData): Promise<void> {
|
async handle(data: CalendarEventListFetchJobData): Promise<void> {
|
||||||
console.time('CalendarEventListFetchJob time');
|
|
||||||
|
|
||||||
const { workspaceId, calendarChannelId } = data;
|
const { workspaceId, calendarChannelId } = data;
|
||||||
|
|
||||||
const calendarChannelRepository =
|
const calendarChannelRepository =
|
||||||
@ -83,6 +81,5 @@ export class CalendarEventListFetchJob {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
console.timeEnd('CalendarEventListFetchJob time');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,8 +28,6 @@ export class CalendarEventsImportJob {
|
|||||||
|
|
||||||
@Process(CalendarEventsImportJob.name)
|
@Process(CalendarEventsImportJob.name)
|
||||||
async handle(data: CalendarEventsImportJobData): Promise<void> {
|
async handle(data: CalendarEventsImportJobData): Promise<void> {
|
||||||
console.time('CalendarEventsImportJob time');
|
|
||||||
|
|
||||||
const { calendarChannelId, workspaceId } = data;
|
const { calendarChannelId, workspaceId } = data;
|
||||||
|
|
||||||
const calendarChannelRepository =
|
const calendarChannelRepository =
|
||||||
@ -69,7 +67,5 @@ export class CalendarEventsImportJob {
|
|||||||
calendarChannel.connectedAccount,
|
calendarChannel.connectedAccount,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
);
|
);
|
||||||
|
|
||||||
console.timeEnd('CalendarEventsImportJob time');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,8 +42,6 @@ export class MessagingMessageListFetchCronJob {
|
|||||||
MESSAGING_MESSAGE_LIST_FETCH_CRON_PATTERN,
|
MESSAGING_MESSAGE_LIST_FETCH_CRON_PATTERN,
|
||||||
)
|
)
|
||||||
async handle(): Promise<void> {
|
async handle(): Promise<void> {
|
||||||
console.time('MessagingMessageListFetchCronJob time');
|
|
||||||
|
|
||||||
const activeWorkspaces = await this.workspaceRepository.find({
|
const activeWorkspaces = await this.workspaceRepository.find({
|
||||||
where: {
|
where: {
|
||||||
activationStatus: WorkspaceActivationStatus.ACTIVE,
|
activationStatus: WorkspaceActivationStatus.ACTIVE,
|
||||||
@ -85,7 +83,5 @@ export class MessagingMessageListFetchCronJob {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.timeEnd('MessagingMessageListFetchCronJob time');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,8 +42,6 @@ export class MessagingMessagesImportCronJob {
|
|||||||
MESSAGING_MESSAGES_IMPORT_CRON_PATTERN,
|
MESSAGING_MESSAGES_IMPORT_CRON_PATTERN,
|
||||||
)
|
)
|
||||||
async handle(): Promise<void> {
|
async handle(): Promise<void> {
|
||||||
console.time('MessagingMessagesImportCronJob time');
|
|
||||||
|
|
||||||
const activeWorkspaces = await this.workspaceRepository.find({
|
const activeWorkspaces = await this.workspaceRepository.find({
|
||||||
where: {
|
where: {
|
||||||
activationStatus: WorkspaceActivationStatus.ACTIVE,
|
activationStatus: WorkspaceActivationStatus.ACTIVE,
|
||||||
@ -82,7 +80,5 @@ export class MessagingMessagesImportCronJob {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.timeEnd('MessagingMessagesImportCronJob time');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,8 +34,6 @@ export class MessagingMessageListFetchJob {
|
|||||||
|
|
||||||
@Process(MessagingMessageListFetchJob.name)
|
@Process(MessagingMessageListFetchJob.name)
|
||||||
async handle(data: MessagingMessageListFetchJobData): Promise<void> {
|
async handle(data: MessagingMessageListFetchJobData): Promise<void> {
|
||||||
console.time('MessagingMessageListFetchJob time');
|
|
||||||
|
|
||||||
const { messageChannelId, workspaceId } = data;
|
const { messageChannelId, workspaceId } = data;
|
||||||
|
|
||||||
await this.messagingTelemetryService.track({
|
await this.messagingTelemetryService.track({
|
||||||
@ -133,7 +131,5 @@ export class MessagingMessageListFetchJob {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.timeEnd('MessagingMessageListFetchJob time');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,8 +30,6 @@ export class MessagingMessagesImportJob {
|
|||||||
|
|
||||||
@Process(MessagingMessagesImportJob.name)
|
@Process(MessagingMessagesImportJob.name)
|
||||||
async handle(data: MessagingMessagesImportJobData): Promise<void> {
|
async handle(data: MessagingMessagesImportJobData): Promise<void> {
|
||||||
console.time('MessagingMessagesImportJob time');
|
|
||||||
|
|
||||||
const { messageChannelId, workspaceId } = data;
|
const { messageChannelId, workspaceId } = data;
|
||||||
|
|
||||||
await this.messagingTelemetryService.track({
|
await this.messagingTelemetryService.track({
|
||||||
@ -87,7 +85,5 @@ export class MessagingMessagesImportJob {
|
|||||||
messageChannel.connectedAccount,
|
messageChannel.connectedAccount,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
);
|
);
|
||||||
|
|
||||||
console.timeEnd('MessagingMessagesImportJob time');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,8 +42,6 @@ export class MessagingMessageChannelSyncStatusMonitoringCronJob {
|
|||||||
async handle(): Promise<void> {
|
async handle(): Promise<void> {
|
||||||
this.logger.log('Starting message channel sync status monitoring...');
|
this.logger.log('Starting message channel sync status monitoring...');
|
||||||
|
|
||||||
console.time('MessagingMessageChannelSyncStatusMonitoringCronJob time');
|
|
||||||
|
|
||||||
await this.messagingTelemetryService.track({
|
await this.messagingTelemetryService.track({
|
||||||
eventName: 'message_channel.monitoring.sync_status.start',
|
eventName: 'message_channel.monitoring.sync_status.start',
|
||||||
message: 'Starting message channel sync status monitoring',
|
message: 'Starting message channel sync status monitoring',
|
||||||
@ -88,7 +86,5 @@ export class MessagingMessageChannelSyncStatusMonitoringCronJob {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.timeEnd('MessagingMessageChannelSyncStatusMonitoringCronJob time');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user