Skip to content

[Chore/performance test] - 성능 테스트 스크립트 추가#105

Merged
ekgns33 merged 4 commits intomainfrom
chore/performance-test
Jul 2, 2025
Merged

[Chore/performance test] - 성능 테스트 스크립트 추가#105
ekgns33 merged 4 commits intomainfrom
chore/performance-test

Conversation

@ekgns33
Copy link
Contributor

@ekgns33 ekgns33 commented Jun 30, 2025

작업 내역

  • K6 성능 테스트 스크립트 추가
  • 부하 및 시나리오테스트를 위한 ts 모듈 작성
  • 기존에는 한 파일에 셋업, 시나리오, 함수가 모두 존재하여 중복 코드가 발생
  • 셋업, 시나리오, 테스트를 분리하여 진행

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive performance testing suite using k6 and TypeScript, including multiple test scripts simulating diverse user behaviors and load patterns.
    • Added configuration options for customizable test parameters, performance thresholds, and report generation.
    • Provided utility functions and scenario classes to simulate realistic API interactions, including authentication, records browsing, and user profile updates.
    • Included detailed documentation and setup instructions for running and extending performance tests.
  • Chores

    • Updated ignore rules to exclude performance testing artifacts and log files from version control.

@ekgns33 ekgns33 requested a review from jeeheaG June 30, 2025 04:12
@ekgns33 ekgns33 self-assigned this Jun 30, 2025
@ekgns33 ekgns33 added the enhancement New feature or request label Jun 30, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jun 30, 2025

Walkthrough

A comprehensive performance testing suite using k6 and TypeScript was introduced under a new performance directory. This includes configuration, utility libraries, scenario classes for simulating user behavior, and multiple test scripts for varied load patterns. Supporting documentation, project metadata, and .gitignore rules for performance artifacts and logs were also added.

Changes

Files / Groups Change Summary
.gitignore, performance/.gitignore Updated/added ignore rules for performance test artifacts, logs, build outputs, dependencies, IDE/system files, and environment files.
performance/README.md Added documentation detailing setup, usage, and extension of the performance test suite.
performance/package.json Introduced project metadata, scripts for building and running tests, and development dependencies for k6 and TypeScript-based performance testing.
performance/200vu-simulation.js Added a k6 script for simulating 50 virtual users with authentication, token refresh, and randomized query parameter generation for load testing.
performance/src/config/environment.ts Added configuration module exporting environment-based config and test thresholds.
performance/src/lib/types.ts Introduced TypeScript interfaces for user tokens, API request/response types, and test setup data.
performance/src/lib/utils.ts Added utility functions for randomization, date formatting, user ID generation, and query string construction.
performance/src/lib/auth.ts Added authentication helpers for user login and access token refresh, returning tokens for use in tests.
performance/src/lib/api-client.ts Introduced ApiClient class for authenticated GET/PATCH requests with automatic token refresh and retry logic.
performance/src/scenarios/records-browsing.ts Added RecordsBrowsingScenarios class to simulate various record browsing patterns with randomized parameters and token management.
performance/src/scenarios/user-profile.ts Added UserProfileScenarios class for user profile retrieval and update scenarios, with probabilistic and heavy update flows.
performance/src/scenarios/real-user-patterns.ts Introduced RealUserPatterns class to model realistic user session behaviors by composing record and profile scenarios.
performance/src/tests/basic-load.ts Added a basic load test script with grouped scenarios, setup, and summary reporting.
performance/src/tests/simple-iteration.ts Added a simple iteration test script for single-user, repeated record queries.
performance/src/tests/multi-scenario.ts Introduced a multi-scenario test script with separate flows for record browsing and user profile endpoints.
performance/src/tests/real-user-simulation.ts Added a script simulating real-world user traffic patterns throughout the day with multiple scenario types and staged load.

Sequence Diagram(s)

sequenceDiagram
    participant TestScript
    participant Setup
    participant Auth
    participant ApiClient
    participant API

    TestScript->>Setup: Generate user IDs
    Setup->>Auth: setupUsers(userIds)
    Auth->>API: POST /test-login
    API-->>Auth: {accessToken, refreshToken}
    Auth-->>Setup: tokens[]
    Setup-->>TestScript: tokens[]

    loop For each scenario iteration
        TestScript->>ApiClient: get/patch(endpoint, token, params)
        ApiClient->>API: HTTP Request with accessToken
        alt 401 Unauthorized
            ApiClient->>Auth: refreshAccessToken(refreshToken)
            Auth->>API: POST /token/refresh
            API-->>Auth: new accessToken
            Auth-->>ApiClient: new accessToken
            ApiClient->>API: Retry HTTP Request with new accessToken
        end
        API-->>ApiClient: Response
        ApiClient-->>TestScript: {response, success, newToken?}
    end
Loading

Suggested labels

:computer: Infrastructure

Suggested reviewers

  • jeeheaG

Poem

🐇
In the warren of code, new tests arise,
Simulating users, both heavy and wise.
With tokens refreshed and records in tow,
The rabbits run load, letting metrics flow.
Logs are ignored, reports are spun—
Performance is measured, and carrots are won!
🥕

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 17

🧹 Nitpick comments (6)
performance/src/config/environment.ts (1)

1-17: Add validation for parsed environment variables.

The configuration structure is well-organized, but consider adding validation to prevent issues from invalid environment variable values.

Apply this diff to add basic validation:

export const config = {
  baseUrl: __ENV.API_BASE_URL || 'http://localhost:8080/api/v1',
-  maxUsers: parseInt(__ENV.MAX_USERS || '1'),
+  maxUsers: Math.max(1, parseInt(__ENV.MAX_USERS || '1') || 1),
  testDuration: __ENV.TEST_DURATION || '2m',
  
  // Thresholds
-  httpReqDurationP95: parseInt(__ENV.HTTP_REQ_DURATION_P95 || '1000'),
-  httpReqFailedRate: parseFloat(__ENV.HTTP_REQ_FAILED_RATE || '0.01'),
+  httpReqDurationP95: Math.max(100, parseInt(__ENV.HTTP_REQ_DURATION_P95 || '1000') || 1000),
+  httpReqFailedRate: Math.min(1.0, Math.max(0, parseFloat(__ENV.HTTP_REQ_FAILED_RATE || '0.01') || 0.01)),
  
  // Report settings
  enableHtmlReport: (__ENV.ENABLE_HTML_REPORT || 'true') === 'true',
};

This ensures parsed values have sensible bounds and handles NaN cases gracefully.

performance/src/tests/basic-load.ts (1)

45-55: Enhance error handling in summary formatting.

The template string could fail if metrics are undefined or have unexpected structure. Add null checks for robustness.

  const textSummary = `
========== API 성능 측정 결과 ==========

- 총 요청 수: ${data.metrics.http_reqs?.values.count || 0}
- 총 실패 수: ${data.metrics.http_req_failed?.values.count || 0}
- 평균 응답 시간: ${data.metrics.http_req_duration?.values.avg?.toFixed(2) || 0} ms
- 최대 응답 시간: ${data.metrics.http_req_duration?.values.max?.toFixed(2) || 0} ms
- p95 응답 시간: ${data.metrics.http_req_duration?.values['p(95)']?.toFixed(2) || 0} ms

==================================
  `;
performance/src/tests/multi-scenario.ts (2)

52-55: Remove magic number in teardown function.

The hardcoded duration value (120 seconds) should be calculated from the actual test duration or configuration.

  export function teardown() {
-   const totalDurationInSeconds = 120; // 2분
+   const totalDurationInSeconds = parseInt(config.testDuration.replace(/[^0-9]/g, '')) * 60; // Parse duration from config
    console.log(`\n---\n📊 다중 시나리오 테스트 완료\n---`);
  }

38-40: Consider adding documentation for the empty default function.

The empty default function might confuse developers. Add a comment explaining why it's intentionally empty.

  export default function(data: TestSetupData) {
-   // 기본 함수는 비워둠 (시나리오별 exec 함수 사용)
+   // Intentionally empty - this test uses scenario-specific exec functions (normal, mypage)
+   // The actual test logic is implemented in the individual scenario functions below
  }
performance/src/scenarios/user-profile.ts (1)

31-31: Consider the impact of probabilistic execution on load testing.

The random probability checks (Math.random() > probability) make the load pattern unpredictable. This could complicate performance analysis as the actual request volume will vary between test runs.

Consider using deterministic patterns or documenting this behavior clearly for test result interpretation.

Also applies to: 56-56

performance/src/scenarios/real-user-patterns.ts (1)

17-26: Remove unused variable.

The sessionStart variable is declared but never used in the lightBrowsing method.

  lightBrowsing(tokens: UserToken[]): void {
-   const sessionStart = Date.now();

    this.userScenarios.checkMyPage(tokens);
    sleep(randomFloatBetween(2, 5));

    this.recordsScenarios.simpleRecordsQuery(tokens);
    sleep(randomFloatBetween(1, 3));
  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 495a3a0 and 6ad9ba3.

📒 Files selected for processing (17)
  • .gitignore (1 hunks)
  • performance/.gitignore (1 hunks)
  • performance/200vu-simulation.js (1 hunks)
  • performance/README.md (1 hunks)
  • performance/package.json (1 hunks)
  • performance/src/config/environment.ts (1 hunks)
  • performance/src/lib/api-client.ts (1 hunks)
  • performance/src/lib/auth.ts (1 hunks)
  • performance/src/lib/types.ts (1 hunks)
  • performance/src/lib/utils.ts (1 hunks)
  • performance/src/scenarios/real-user-patterns.ts (1 hunks)
  • performance/src/scenarios/records-browsing.ts (1 hunks)
  • performance/src/scenarios/user-profile.ts (1 hunks)
  • performance/src/tests/basic-load.ts (1 hunks)
  • performance/src/tests/multi-scenario.ts (1 hunks)
  • performance/src/tests/real-user-simulation.ts (1 hunks)
  • performance/src/tests/simple-iteration.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (8)
performance/src/tests/simple-iteration.ts (5)
performance/src/config/environment.ts (1)
  • config (1-12)
performance/src/lib/types.ts (1)
  • TestSetupData (7-9)
performance/src/lib/utils.ts (1)
  • generateUserIds (19-21)
performance/src/lib/auth.ts (1)
  • setupUsers (6-35)
performance/src/scenarios/records-browsing.ts (1)
  • RecordsBrowsingScenarios (6-122)
performance/src/lib/utils.ts (1)
performance/200vu-simulation.js (3)
  • date (181-181)
  • i (9-9)
  • queryString (117-117)
performance/src/tests/basic-load.ts (5)
performance/src/lib/types.ts (1)
  • TestSetupData (7-9)
performance/src/lib/utils.ts (1)
  • generateUserIds (19-21)
performance/src/config/environment.ts (1)
  • config (1-12)
performance/src/lib/auth.ts (1)
  • setupUsers (6-35)
performance/src/scenarios/records-browsing.ts (1)
  • RecordsBrowsingScenarios (6-122)
performance/src/lib/auth.ts (3)
performance/src/lib/types.ts (1)
  • UserToken (1-5)
performance/200vu-simulation.js (2)
  • tokens (15-15)
  • success (53-55)
performance/src/config/environment.ts (1)
  • config (1-12)
performance/src/tests/multi-scenario.ts (6)
performance/src/lib/types.ts (1)
  • TestSetupData (7-9)
performance/src/lib/utils.ts (1)
  • generateUserIds (19-21)
performance/src/config/environment.ts (1)
  • config (1-12)
performance/src/lib/auth.ts (1)
  • setupUsers (6-35)
performance/src/scenarios/user-profile.ts (1)
  • UserProfileScenarios (6-78)
performance/src/scenarios/records-browsing.ts (1)
  • RecordsBrowsingScenarios (6-122)
performance/src/scenarios/real-user-patterns.ts (4)
performance/src/scenarios/records-browsing.ts (1)
  • RecordsBrowsingScenarios (6-122)
performance/src/scenarios/user-profile.ts (1)
  • UserProfileScenarios (6-78)
performance/src/lib/types.ts (1)
  • UserToken (1-5)
performance/src/lib/utils.ts (2)
  • randomFloatBetween (5-7)
  • randomIntBetween (1-3)
performance/src/lib/api-client.ts (4)
performance/src/config/environment.ts (1)
  • config (1-12)
performance/src/lib/types.ts (3)
  • UserToken (1-5)
  • QueryParams (11-16)
  • RequestResult (24-28)
performance/src/lib/utils.ts (1)
  • buildQueryString (23-30)
performance/src/lib/auth.ts (1)
  • refreshAccessToken (37-60)
performance/200vu-simulation.js (3)
performance/src/tests/multi-scenario.ts (5)
  • options (9-30)
  • setup (32-36)
  • mypage (42-45)
  • normal (47-50)
  • teardown (52-55)
performance/src/lib/auth.ts (1)
  • refreshAccessToken (37-60)
performance/src/lib/utils.ts (3)
  • randomIntBetween (1-3)
  • getRandomDateInPast (13-17)
  • formatDate (9-11)
🪛 Biome (1.9.4)
performance/200vu-simulation.js

[error] 49-49: expected , but instead found ;

Remove ;

(parse)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and analyze
🔇 Additional comments (19)
.gitignore (1)

41-52: LGTM! Comprehensive performance testing exclusions.

The gitignore additions properly exclude performance testing artifacts while maintaining good organization with directory-specific patterns. The inclusion of both specific performance directory patterns and a general logs/ exclusion covers the expected build outputs, dependencies, environment files, and reports.

performance/.gitignore (1)

1-71: Excellent comprehensive gitignore configuration.

This gitignore file provides thorough coverage of all typical artifacts for a Node.js/TypeScript performance testing project. The organization with clear section comments and the inclusion of both common and k6-specific patterns demonstrates good attention to detail. The exception for .vscode/extensions.json is a nice touch for team development consistency.

performance/src/lib/utils.ts (1)

1-30: Well-implemented utility functions with proper edge case handling.

The utility functions are correctly implemented with good attention to detail:

  • Random number generators use proper inclusive/exclusive bounds
  • Date formatting produces standard ISO date format (YYYY-MM-DD)
  • Query string builder properly filters null/undefined values and URL-encodes parameters
  • User ID generation creates clean sequential arrays

These utilities provide a solid foundation for the performance testing framework.

performance/src/lib/types.ts (1)

1-28: Well-structured interfaces for performance testing framework.

The type definitions provide a clean abstraction layer for authentication, API communication, and test data management. The interfaces are appropriately designed for their use cases:

  • UserToken covers standard JWT authentication flow
  • QueryParams provides flexible API query parameter typing
  • ApiResponse with a json() method suggests smart response parsing capabilities
  • RequestResult elegantly handles authentication token refresh scenarios

The use of any for the response body maintains flexibility while other fields remain strongly typed.

performance/src/lib/auth.ts (2)

6-35: LGTM: Well-structured authentication setup function.

The setupUsers function properly handles user authentication with appropriate error handling and logging. The implementation correctly:

  • Validates successful login responses using k6's check function
  • Handles failed logins gracefully with error logging
  • Returns structured token data matching the UserToken interface

37-60: LGTM: Robust token refresh implementation.

The refreshAccessToken function implements proper token refresh logic with:

  • Correct HTTP headers including both Content-Type and Authorization
  • Response validation using k6's check function
  • Proper error handling and logging
  • Tags for request categorization
performance/README.md (1)

1-60: LGTM: Comprehensive and well-structured documentation.

The README provides clear, step-by-step instructions for:

  • Installation and setup
  • Environment configuration
  • Building and running tests
  • Development workflow
  • Extending the test suite

The Korean documentation is well-organized and covers all necessary aspects for team members to effectively use the performance testing framework.

performance/src/tests/simple-iteration.ts (1)

8-18: LGTM: Well-configured simple iteration test.

The test options are properly configured with:

  • Single VU for controlled testing
  • Reasonable iteration count (100)
  • Environment-based duration configuration
  • Proper threshold integration
performance/src/lib/api-client.ts (3)

7-12: LGTM: Clean constructor implementation.

The constructor properly defaults to the configured base URL and maintains good separation of concerns.


14-43: Potential concurrency issue with token mutation.

The get method directly mutates the token array through reference (tokens[vuIndex].accessToken = result.newToken). In k6's concurrent execution model, this could lead to race conditions where multiple virtual users modify the same token simultaneously.

Consider using a thread-safe token management approach or document this limitation clearly.

  // Add a comment to clarify the intended usage
+ // Note: Token updates are not thread-safe. Use with caution in high-concurrency scenarios.
  if (result.newToken) {
    tokens[vuIndex].accessToken = result.newToken;
  }

Likely an incorrect or invalid review comment.


68-68: Confirm 409 Conflict handling in PATCH calls

We’ve verified that in performance/src/lib/api-client.ts, the patch wrapper marks a 409 response as success on lines 68 and 76. Please ensure this aligns with your API’s contract:

• performance/src/lib/api-client.ts:68
• performance/src/lib/api-client.ts:76

Verify against your API specification that a 409 Conflict on PATCH should be treated as a successful or idempotent outcome. If only specific endpoints may legitimately return 409, consider restricting this logic to those cases.

performance/src/scenarios/user-profile.ts (2)

6-11: LGTM: Clean constructor and class structure.

The class follows good composition patterns by using the ApiClient for HTTP operations.


30-52: Verify the eggId mapping against the API design

The assumption that eggId is the same as user.user_id couldn’t be confirmed in the codebase. Please ensure this mapping matches the API’s specification or adjust accordingly.

  • File: performance/src/scenarios/user-profile.ts
  • Method: updateEgg (lines 30–52)
performance/src/scenarios/real-user-patterns.ts (2)

7-14: Excellent use of composition pattern.

The class effectively composes RecordsBrowsingScenarios and UserProfileScenarios to create realistic user behavior patterns. This promotes code reuse and maintainability.


16-58: Well-designed user behavior modeling.

The different session methods (lightBrowsing, browsing_session, activeUserSession, heavyUserSession) effectively model varying user activity levels with appropriate randomization and realistic delays.

performance/src/tests/real-user-simulation.ts (2)

8-12: Well-configured performance thresholds.

The thresholds are appropriately set for a performance test - 5% failure rate and reasonable response time percentiles (95th < 2s, 99th < 5s) provide good baseline expectations.


14-70: Excellent scenario design for realistic daily traffic simulation.

The scenarios effectively model real-world usage patterns:

  • Morning rush with ramping arrival rate
  • Lunch time constant load
  • Evening peak with highest load
  • Night time low load

The executor types and parameters are well-chosen for each time period.

performance/src/scenarios/records-browsing.ts (2)

6-11: Good class structure and API client integration.

The constructor properly initializes the API client, and the class encapsulates browsing scenarios well.


36-41: Excellent token management implementation.

The token refresh logic properly updates the tokens array when a new token is returned, ensuring other VUs can benefit from the refreshed token.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
performance/src/scenarios/records-browsing.ts (2)

13-31: Fix inconsistent indentation in the helper method.

The generateQueryParams method has inconsistent indentation that affects code readability.

  private generateQueryParams(maxDaysBack: number = 30): QueryParams {
-
-    const params: QueryParams = {
-          page: randomIntBetween(0, 5),
-          size: randomIntBetween(1, 20),
-        };
-
-        let startDate = getRandomDateInPast(maxDaysBack);
-        let endDate = getRandomDateInPast(maxDaysBack);
-
-        if (startDate > endDate) {
-          [startDate, endDate] = [endDate, startDate];
-        }
-
-        params.startDate = formatDate(startDate);
-        params.endDate = formatDate(endDate);
-
-       return params;
+    const params: QueryParams = {
+      page: randomIntBetween(0, 5),
+      size: randomIntBetween(1, 20),
+    };
+
+    let startDate = getRandomDateInPast(maxDaysBack);
+    let endDate = getRandomDateInPast(maxDaysBack);
+
+    if (startDate > endDate) {
+      [startDate, endDate] = [endDate, startDate];
+    }
+
+    params.startDate = formatDate(startDate);
+    params.endDate = formatDate(endDate);
+
+    return params;
  }

85-89: Optimize parameter generation to avoid unnecessary random page generation.

The method generates a random page number via generateQueryParams() but immediately overwrites it with the loop index i. This is inefficient and potentially confusing.

Consider one of these approaches:

Option 1: Add parameters to the helper method

- const params = this.generateQueryParams(60);
- params.page = i;
- params.size = randomIntBetween(5, 20);
+ const params = this.generateQueryParams(60, i, randomIntBetween(5, 20));

Option 2: Generate parameters directly for this specific use case

- const params = this.generateQueryParams(60);
- params.page = i;
- params.size = randomIntBetween(5, 20);
+ const params: QueryParams = {
+   page: i,
+   size: randomIntBetween(5, 20),
+ };
+ 
+ let startDate = getRandomDateInPast(60);
+ let endDate = getRandomDateInPast(60);
+ 
+ if (startDate > endDate) {
+   [startDate, endDate] = [endDate, startDate];
+ }
+ 
+ params.startDate = formatDate(startDate);
+ params.endDate = formatDate(endDate);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ad9ba3 and 42670d0.

📒 Files selected for processing (4)
  • performance/src/scenarios/records-browsing.ts (1 hunks)
  • performance/src/tests/basic-load.ts (1 hunks)
  • performance/src/tests/real-user-simulation.ts (1 hunks)
  • performance/src/tests/simple-iteration.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • performance/src/tests/simple-iteration.ts
  • performance/src/tests/basic-load.ts
  • performance/src/tests/real-user-simulation.ts
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ekgns33
PR: Run-Us/Runimo#105
File: performance/package.json:13-13
Timestamp: 2025-06-30T04:22:51.529Z
Learning: In the performance testing directory of the Run-Us/Runimo repository, the file `200vu-simulation.js` is legacy JavaScript code kept for reference purposes only and should not be integrated into the npm scripts or main test suite. The project uses TypeScript-based K6 performance tests as the active testing approach.
performance/src/scenarios/records-browsing.ts (1)
Learnt from: ekgns33
PR: Run-Us/Runimo#105
File: performance/package.json:13-13
Timestamp: 2025-06-30T04:22:51.529Z
Learning: In the performance testing directory of the Run-Us/Runimo repository, the file `200vu-simulation.js` is legacy JavaScript code kept for reference purposes only and should not be integrated into the npm scripts or main test suite. The project uses TypeScript-based K6 performance tests as the active testing approach.
🧬 Code Graph Analysis (1)
performance/src/scenarios/records-browsing.ts (4)
performance/src/lib/api-client.ts (1)
  • ApiClient (7-79)
performance/src/lib/types.ts (2)
  • QueryParams (11-16)
  • UserToken (1-5)
performance/src/lib/utils.ts (4)
  • randomIntBetween (1-3)
  • getRandomDateInPast (13-17)
  • formatDate (9-11)
  • randomFloatBetween (5-7)
performance/200vu-simulation.js (6)
  • startDate (108-108)
  • endDate (109-109)
  • tokens (15-15)
  • vuIndex (79-79)
  • vuIndex (104-104)
  • i (9-9)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build and analyze
🔇 Additional comments (2)
performance/src/scenarios/records-browsing.ts (2)

34-58: Well-implemented scenario method with proper error handling.

The basicRecordsQuery method correctly uses the extracted helper method and includes appropriate error logging and token management.


61-78: Scenario method correctly implements intended design differences.

The simpleRecordsQuery method properly uses the helper method and maintains the intentional differences (fixed sleep timing and no error logging) for this specific test scenario.

@sonarqubecloud
Copy link

Copy link
Contributor

@jeeheaG jeeheaG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

우와 타입스크립트다.. 분리 고생하셨습니다..!

@ekgns33 ekgns33 merged commit 9b8fb1a into main Jul 2, 2025
4 checks passed
@ekgns33 ekgns33 deleted the chore/performance-test branch July 2, 2025 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants