Skip to content

Commit

Permalink
fix: 통합 테스트 코드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
fru1tworld committed Dec 2, 2024
1 parent 642f494 commit d164560
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions packages/backend/src/test/test.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,56 +156,4 @@ export class TestController {
difference: Math.abs(mysqlDuration - mongoDuration),
};
}

@Get('concurrent')
async testConcurrentOperations(): Promise<PerformanceResult> {
this.logger.log('Testing concurrent operations for Space.');
const iterations = 500;

const mysqlStartTime = process.hrtime();
await Promise.all([
...Array(iterations)
.fill(null)
.map(() => this.testService.findSpaceByIdSQL(spaceMockData[0].id)),
...Array(iterations)
.fill(null)
.map((_, index) =>
this.testService.createSpaceSQL({
...spaceMockData[0],
id: `concurrent-test-space-${index}`,
}),
),
]);
const mysqlEndTime = process.hrtime(mysqlStartTime);
const mysqlDuration = (mysqlEndTime[0] * 1e9 + mysqlEndTime[1]) / 1e6;

const mongoStartTime = process.hrtime();
await Promise.all([
...Array(iterations)
.fill(null)
.map(() => this.testService.findSpaceByIdMongo(spaceMockData[0].id)),
...Array(iterations)
.fill(null)
.map((_, index) =>
this.testService.createSpaceMongo({
...spaceMockData[0],
id: `concurrent-test-space-${index}`,
}),
),
]);
const mongoEndTime = process.hrtime(mongoStartTime);
const mongoDuration = (mongoEndTime[0] * 1e9 + mongoEndTime[1]) / 1e6;

this.logger.log('Concurrent operations test for Space completed.', {
mysqlDuration,
mongoDuration,
difference: Math.abs(mysqlDuration - mongoDuration),
});

return {
mysqlDuration,
mongoDuration,
difference: Math.abs(mysqlDuration - mongoDuration),
};
}
}

0 comments on commit d164560

Please sign in to comment.