Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #123

Open
wants to merge 1 commit into
base: the-one
Choose a base branch
from

Conversation

TimWallaceDev
Copy link
Contributor

@TimWallaceDev TimWallaceDev commented Nov 11, 2024

The Pull Request is ready

  • fixes #1126
  • all actions are passing
  • only fixes a single issue

Overview

Updated the README.md to add instructions for getting started and creating a benchmark project.

CLI

  • the change works with both supported node versions
  • the default behaviour did not change
  • shared code has been extracted in a different file

Summary by CodeRabbit

  • Documentation
    • Updated the README.md with new sections for creating and managing benchmark projects using the CLI tool.
    • Added detailed instructions for creating a new benchmark project and adding routes.
    • Included guidance on running benchmarks with best practices for thread count.

Copy link

coderabbitai bot commented Nov 11, 2024

Walkthrough

The pull request updates the README.md file to enhance documentation for creating and managing benchmark projects using the CLI tool of the @idrinth-api-bench/framework. It introduces new subsections detailing the process of creating a benchmark project, adding routes, and running benchmarks, including specific commands and best practices to follow.

Changes

File Change Summary
README.md Added sections for creating a new benchmark project, adding routes, and running benchmarks with detailed instructions.

Possibly related PRs

  • V1.0.0 #36: The changes in this PR involve updates to the CLI tool's import statements and dependencies related to @idrinth-api-bench/framework, which is directly relevant to the enhancements made in the main PR regarding the CLI tool's documentation for managing benchmark projects.

Poem

🐇 In the meadow where benchmarks grow,
A guide was crafted, step by step, you know.
With commands to run and routes to pave,
The CLI's secrets, now clear and brave.
Hop along, dear user, to projects anew,
With each little change, there's much you can do! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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: 0

🧹 Outside diff range and nitpick comments (4)
README.md (4)

27-50: Improve setup instructions clarity and formatting

The setup instructions need some refinements:

  1. The repository URL might confuse users - they likely need to create their own project rather than clone the CLI repository
  2. The npm run language step needs more context about what it does
  3. The markdown formatting needs improvement for better readability

Consider this revised structure:

### Creating a new benchmark project

1. Create a new directory for your project:
   ```bash
   mkdir my-benchmark-project
   cd my-benchmark-project
  1. Initialize the project:

    npm init -y
  2. Install the CLI tool:

    npm install @idrinth-api-bench/cli
  3. Generate a new benchmark project:

    npx iabc

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint</summary>

47-47: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)

---

32-32: Expected: 1; Actual: 2; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)

---

37-37: Expected: 1; Actual: 3; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)

---

42-42: Expected: 1; Actual: 4; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)

---

47-47: Expected: 1; Actual: 5; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)

---

28-28: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

33-33: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

38-38: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

43-43: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

48-48: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

27-27: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

---

32-32: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

---

37-37: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

---

42-42: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

---

47-47: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

</details>

</details>

---

`54-69`: **Enhance route configuration documentation**

The example would be more helpful with additional context explaining:
- The purpose and requirements of each configuration property
- Available options for pre/post conditions
- What this specific example is testing (ReqRes API user endpoint)


Consider adding explanatory comments:

```diff
 1. Create a new file at src/routes/main/first-test.ts with the following content:
    ```typescript
    export default () => ({
      // Unique identifier for this test case
      id: 'example test case',
      
      // Main request configuration
      main: {
        method: 'get',
        url: 'https://reqres.in/api/users',
      },
      
      // Pre-request validations
      pre: [
        '^user-agent',  // Ensures proper user agent is set
      ],
      
      // Post-request validations
      post: [
        '^status-2xx',  // Ensures response status is in 2xx range
      ],
    });
    ```
🧰 Tools
🪛 Markdownlint

55-55: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


54-54: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


71-80: Improve benchmark execution instructions

The instructions contain some grammatical issues and could be clearer:

Apply these improvements:

-3. Please don't try to create a service denial scenario and keep the thread count low. Creating a service denial scenario could result in the machine or network resource to become unavailable to intended users. You can use flags to modify the threads and repetitions. The total amount of requests will be threads X repetitions. Eg. 4 threads X 25 repetitions = 100 requests total. 
+3. Important: Keep the thread count low to avoid creating denial of service scenarios that could make services unavailable to other users. You can use flags to modify the number of threads and repetitions. The total number of requests will be threads × repetitions (e.g., 4 threads × 25 repetitions = 100 requests total).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~77-~77: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ... the threads and repetitions. The total amount of requests will be threads X repetitio...

(AMOUNTOF_TO_NUMBEROF)


[uncategorized] ~77-~77: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...requests will be threads X repetitions. Eg. 4 threads X 25 repetitions = 100 reques...

(E_G)

🪛 Markdownlint

77-77: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


71-71: Expected: 1; Actual: 2; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


77-77: Expected: 1; Actual: 3; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


72-72: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


78-78: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


71-71: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


77-77: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


25-81: Fix markdown formatting issues

The document has several formatting inconsistencies that should be addressed:

  1. Add blank lines around lists and code blocks
  2. Use consistent list numbering style
  3. Ensure proper spacing throughout the document

Would you like me to provide a fully formatted version of the document that addresses all these issues?

🧰 Tools
🪛 LanguageTool

[uncategorized] ~77-~77: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ... the threads and repetitions. The total amount of requests will be threads X repetitio...

(AMOUNTOF_TO_NUMBEROF)


[uncategorized] ~77-~77: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...requests will be threads X repetitions. Eg. 4 threads X 25 repetitions = 100 reques...

(E_G)

🪛 Markdownlint

47-47: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


77-77: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


32-32: Expected: 1; Actual: 2; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


37-37: Expected: 1; Actual: 3; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


42-42: Expected: 1; Actual: 4; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


47-47: Expected: 1; Actual: 5; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


71-71: Expected: 1; Actual: 2; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


77-77: Expected: 1; Actual: 3; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


28-28: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


33-33: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


38-38: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


43-43: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


48-48: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


55-55: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


72-72: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


78-78: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


27-27: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


32-32: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


37-37: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


42-42: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


47-47: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


54-54: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


71-71: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


77-77: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1437690 and 62fa8fd.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[uncategorized] ~77-~77: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ... the threads and repetitions. The total amount of requests will be threads X repetitio...

(AMOUNTOF_TO_NUMBEROF)


[uncategorized] ~77-~77: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...requests will be threads X repetitions. Eg. 4 threads X 25 repetitions = 100 reques...

(E_G)

🪛 Markdownlint
README.md

47-47: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


77-77: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


32-32: Expected: 1; Actual: 2; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


37-37: Expected: 1; Actual: 3; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


42-42: Expected: 1; Actual: 4; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


47-47: Expected: 1; Actual: 5; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


71-71: Expected: 1; Actual: 2; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


77-77: Expected: 1; Actual: 3; Style: 1/1/1
Ordered list item prefix

(MD029, ol-prefix)


28-28: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


33-33: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


38-38: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


43-43: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


48-48: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


55-55: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


72-72: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


78-78: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


27-27: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


32-32: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


37-37: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


42-42: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


47-47: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


54-54: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


71-71: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)


77-77: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

Copy link
Member

@Idrinth Idrinth left a comment

Choose a reason for hiding this comment

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

Thanks for the update, it seems you mixed up projects though

@@ -22,6 +22,63 @@ This project provides a CLI tool for @idrinth-api-bench/framework to generate co

## Usage & Examples

### Creating a new benchmark project
Copy link
Member

Choose a reason for hiding this comment

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

this is the cli, you added the description of the framework. The cli is there to generate routes and folder structures, usually you will not need to clone it at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants