Module: Perfgate

Defined in:
lib/perfgate.rb,
lib/perfgate/cli.rb,
lib/perfgate/rspec.rb,
lib/perfgate/config.rb,
lib/perfgate/errors.rb,
lib/perfgate/version.rb,
lib/perfgate/config/schema.rb,
lib/perfgate/policy/engine.rb,
lib/perfgate/report/console.rb,
lib/perfgate/cli/run_command.rb,
lib/perfgate/config/defaults.rb,
lib/perfgate/instrumentation.rb,
lib/perfgate/report/markdown.rb,
lib/perfgate/rspec/discovery.rb,
lib/perfgate/storage/adapter.rb,
lib/perfgate/storage/archive.rb,
lib/perfgate/config/validator.rb,
lib/perfgate/execution/runner.rb,
lib/perfgate/comparison/engine.rb,
lib/perfgate/rspec/id_resolver.rb,
lib/perfgate/instrumentation/gc.rb,
lib/perfgate/statistics/summary.rb,
lib/perfgate/storage/filesystem.rb,
lib/perfgate/workloads/registry.rb,
lib/perfgate/workloads/workload.rb,
lib/perfgate/cli/compare_command.rb,
lib/perfgate/config/env_overrides.rb,
lib/perfgate/comparison/diagnostics.rb,
lib/perfgate/rspec/workload_builder.rb,
lib/perfgate/fingerprints/components.rb,
lib/perfgate/comparison/metric_change.rb,
lib/perfgate/execution/process_runner.rb,
lib/perfgate/execution/sample_context.rb,
lib/perfgate/instrumentation/duration.rb,
lib/perfgate/serialization/run_result.rb,
lib/perfgate/statistics/mann_whitney_u.rb,
lib/perfgate/comparison/metric_decision.rb,
lib/perfgate/fingerprints/compatibility.rb,
lib/perfgate/cli/run_comparison_reporter.rb,
lib/perfgate/instrumentation/allocations.rb,
lib/perfgate/instrumentation/sql_activity.rb,
lib/perfgate/comparison/workload_comparison.rb,
lib/perfgate/fingerprints/workload_definition.rb,
lib/perfgate/comparison/statistical_metric_decision.rb,
lib/perfgate/comparison/deterministic_metric_decision.rb,
sig/perfgate.rbs

Overview

Baseline is a CI-native performance assurance tool for Ruby on Rails applications. It converts selected RSpec examples into repeatable performance workloads and compares them against a compatible default-branch baseline to produce a merge-gate decision.

Defined Under Namespace

Modules: Comparison, Execution, Fingerprints, Instrumentation, Policy, RSpec, Report, Serialization, Statistics, Storage, Workloads Classes: CLI, Config, ConfigurationError, Error, IncompatibleRunError, ResultBundleError, WorkloadError

Constant Summary collapse

VERSION =

Returns:

  • (String)
"0.1.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

The active configuration, loaded via Config.load or Config.default. baseline run assigns this after loading baseline.yml.



28
29
30
# File 'lib/perfgate.rb', line 28

def configuration
  @configuration ||= Config.default
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields the active configuration for in-code customization, e.g. Perfgate.configure { |config| config.dataset_fingerprint = -> { ... } } (spec section 12.3).

Yields:



37
38
39
# File 'lib/perfgate.rb', line 37

def configure
  yield configuration
end

.measure(&block) ⇒ Object

Explicitly marks the block whose execution should be measured by Baseline (spec section 9.1). Outside of a running workload sample (e.g. called directly in a plain unit test) this simply executes the block and returns its value without recording anything.



19
20
21
22
23
24
# File 'lib/perfgate.rb', line 19

def measure(&block)
  context = Execution::SampleContext.current
  return block.call unless context

  context.measure(&block)
end

.registryObject

The process-wide workload registry that RSpec discovery populates.



42
43
44
# File 'lib/perfgate.rb', line 42

def registry
  Workloads::Registry.instance
end