Class: Perfgate::CLI::RunCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/perfgate/cli/run_command.rb

Overview

Implements baseline run (spec section 10.2): discovers workloads via the RSpec integration, executes each workload's warmup+samples in an isolated child process, and writes a filesystem result bundle. With --compare PATH, immediately compares the fresh run against a reference bundle and reports/exits like baseline compare would -- this is the single combined step the spec's GitHub Actions example (section 19.1) invokes. --format markdown additionally writes a summary.md into the output directory for a GitHub job summary.

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ RunCommand

Returns a new instance of RunCommand.



22
23
24
25
# File 'lib/perfgate/cli/run_command.rb', line 22

def initialize(argv)
  @argv = argv.dup
  @options = { config: "perfgate.yml" }
end

Instance Method Details

#callObject



27
28
29
30
31
32
33
34
# File 'lib/perfgate/cli/run_command.rb', line 27

def call
  parse_options!
  config = load_configuration
  run_result = execute(config)
  run_dir = save(config, run_result)

  @options[:compare] ? compare_and_report(config, run_result, run_dir) : run_only_report(run_result, run_dir)
end