Skip to content

Merge Queue Tool for stress testing a repository using trunk merge

License

Notifications You must be signed in to change notification settings

trunk-io/mergequeue-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trunk merge queue tool

Welcome

This repository hosts the trunk mergequeue-tool which can be used to demonstrate the performance characteristics of repository managed by trunk merge graph under different simulated loads.

How does it work

Usage: mq [OPTIONS] [COMMAND]

Commands:
  generate       Generate pull requests
  test-sim       Simulate a test with flake rate in consideration
  housekeeping   Clean out conflicting PRs and requeue failed PRs
  config         Print current configuration content to json
  defaultconfig  Generate default configuration content

Options:
      --gh-token <GH_TOKEN>  [default: ]
  -h, --help                 Print help
  -V, --version              Print version

Generate

Running mq generate will attempt to generate pull requests at the configured rate. Generate can operate in two different modes. By setting the mutually exclusive requests_per_hour or requests_per_run value you are specifying to either run in either distributed mode which will try to distribute the generate load across the specified run_generate_for value or burst mode which will attempt to create pull requests as quickly as possible given the specified requests_per_run value.

Burst Mode configuration to create 20 pull requests as quickly as possible

requests_per_run: 20

Distributed Mode configuration to create 25 pull requests over 15 minutes time

requests_per_hour = 100
run_generate_for = "15 minutes"

Configuration

The load imparted onto the connected queue is controlled by the mq.toml file in the .config folder.

The configuration system allows for setting the desired load on the queue, the flake rate and the interdependence element of the pull requests. The tooling is designed to generate pull requests assuming mq generate is called every 10 minutes.

# parallelqueue - will push deps information to the service to take advantage of trunk merge dynamic parallel queues
# singlequeue - single traditional queueu
# Default value: "singlequeue"
#mode = "singlequeue"

# Default value: "none"
#build = "none"

[trunk]
# Default value: "api.trunk.io"
#api = "api.trunk.io"

[git]
# Default value: "Jane Doe"
#name = "Jane Doe"

# Default value: "[email protected]"
#email = "[email protected]"

[pullrequest]
# Default value: ""
#labels = ""

# Default value: ""
#comment = ""

# Default value: "This pull request was generated by the 'mq' tool"
#body = "This pull request was generated by the 'mq' tool"

# Default value: 0
#requests_per_hour = 0

# The desired length of time generate should run for attempting to
# distribute the requests_per_hour over that time period
#
# Default value: "10 minutes"
#run_generate_for = "10 minutes"

# Default value: 0
#requests_per_run = 0

# Default value: "bazel/"
#change_code_path = "bazel/"

# Default value: 1
#max_deps = 1

# Default value: 1
#max_impacted_deps = 1

# Default value: 100
#logical_conflict_every = 100

# Default value: "logical-conflict.txt"
#logical_conflict_file = "logical-conflict.txt"

# Default value: ["removed from the merge queue", "To merge this pull request, check the box to the left", "/trunk merge"]
#detect_stale_pr_comments = ["removed from the merge queue", "To merge this pull request, check the box to the left", "/trunk merge"]

# Default value: "4 hours"
#close_stale_after = "4 hours"

[test]
# Default value: 0.1
#flake_rate = 0.1

# Default value: "1 second"
#sleep_for = "1 second"

[merge]
# Default value: ""
#labels = ""

# Default value: ""
#comment = ""

# Default value: ""
#run = ""