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