Tango icon indicating copy to clipboard operation
Tango copied to clipboard

Adding stress test script

Open dwang3851 opened this issue 1 year ago • 1 comments

Adds a script for basic stress test functionality. This script uses the Tango CLI to simulate various submissions scenarios. The number of submissions can be adjusted as well as the rate at which they are submitted. Required parameters include the autograder image, the path to the Tango directory, the job name, and the path to the job.

Example command to run script:

  • python3 stressTest.py --num_submissions 10 --submission_delay 1.0 --autograder_image autograding_image_py --tango_port 4567 --tango_path ~/Tango --job_name assessment1 --job_path ~/Tango/clients/job1/

To get metrics, simply add --get_metrics True to the end of this command, this will not spawn any new jobs.

dwang3851 avatar Oct 27 '24 17:10 dwang3851

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes introduced in this pull request consist of the addition of a new script, stressTest.py, which facilitates stress testing using the Tango framework. This script includes two main functions: run_stress_test, which submits jobs to the Tango CLI, and get_metrics, which retrieves job completion metrics from a log file. Additionally, the worker.py file has been updated to enhance logging and error handling within the Worker class, improving the tracking of job execution and failure scenarios.

Changes

File Change Summary
stressTest.py Introduced a new script with two functions: run_stress_test for submitting jobs with parameters and logging, and get_metrics for retrieving job completion metrics from a log file. Includes command-line argument parsing.
worker.py Enhanced logging and error handling in the Worker class. Added start_time for tracking job duration, improved error logging in rescheduleJob, and refined exception handling in notifyServer.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant StressTest
    participant TangoCLI
    participant LogFile

    User->>StressTest: run_stress_test(params)
    StressTest->>TangoCLI: submit job
    TangoCLI-->>StressTest: job submission result
    StressTest->>LogFile: log job metrics
    User->>StressTest: get_metrics(output_file)
    StressTest->>LogFile: read job completion metrics
    LogFile-->>StressTest: return metrics
    StressTest-->>User: output metrics

📜 Recent review details

Configuration used: CodeRabbit UI Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 128c25211c91e67d25ddf2c8f38018920a6d3f5b and 6fb153d22f563675fde755268008c8d7130072e9.

📒 Files selected for processing (1)
  • worker.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • worker.py

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.

coderabbitai[bot] avatar Nov 03 '24 17:11 coderabbitai[bot]

This is already merged in copy-in, Soma based his stress test changes using this PR, closing for now

KesterTan avatar Nov 18 '25 20:11 KesterTan