duel 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +68 -1
- data/README.md +22 -5
- data/docs/benchmarks.md +2 -1
- data/docs/ci.md +147 -12
- data/docs/configuration.md +11 -4
- data/docs/how-it-works.md +30 -4
- data/docs/json.md +2 -0
- data/docs/plugins.md +2 -2
- data/docs/troubleshooting.md +14 -0
- data/lib/duel/baseline.rb +4 -4
- data/lib/duel/cli.rb +4 -1
- data/lib/duel/config.rb +13 -6
- data/lib/duel/context.rb +6 -5
- data/lib/duel/init.rb +4 -0
- data/lib/duel/json_report.rb +4 -3
- data/lib/duel/lock.rb +52 -8
- data/lib/duel/native.rb +20 -0
- data/lib/duel/resource.rb +37 -2
- data/lib/duel/runner.rb +98 -9
- data/lib/duel/summary.rb +4 -1
- data/lib/duel/templates/duel.gitlab-ci.yml.erb +23 -4
- data/lib/duel/templates/perf.yml.erb +83 -3
- data/lib/duel/testing.rb +2 -2
- data/lib/duel/version.rb +1 -1
- data/lib/duel/worker.rb +1 -1
- data/sig/duel/config.rbs +3 -0
- data/sig/duel/init.rbs +3 -0
- data/sig/duel/lock.rbs +11 -0
- data/sig/duel/native.rbs +2 -0
- data/sig/duel/resource.rbs +10 -1
- data/sig/duel/runner.rbs +37 -2
- data/sig/duel/summary.rbs +3 -0
- metadata +1 -1
data/sig/duel/resource.rbs
CHANGED
|
@@ -40,7 +40,16 @@ module Duel
|
|
|
40
40
|
# @api private
|
|
41
41
|
def self.environment: (String name, Hash[String, String?] env, Hash[String, String?] vars) -> Hash[String, String?]
|
|
42
42
|
|
|
43
|
-
# The worker it's for ("
|
|
43
|
+
# The worker it's for ("base-1", say).
|
|
44
|
+
# What a cache key names, without its version and hash.
|
|
45
|
+
NAME: Regexp
|
|
46
|
+
|
|
47
|
+
# The builds this process's runs used, by path.
|
|
48
|
+
USED: Set[String]
|
|
49
|
+
|
|
50
|
+
# Removes the builds that ones this process used replace.
|
|
51
|
+
def self.evict: (String cache) -> void
|
|
52
|
+
|
|
44
53
|
attr_reader name: String
|
|
45
54
|
|
|
46
55
|
# The directory it has of its own.
|
data/sig/duel/runner.rbs
CHANGED
|
@@ -16,6 +16,10 @@ module Duel
|
|
|
16
16
|
# @api private
|
|
17
17
|
YJIT_WARM: Float
|
|
18
18
|
|
|
19
|
+
# The seconds a run measures for, at most, by default.
|
|
20
|
+
# @api private
|
|
21
|
+
TIME_LIMIT: Float
|
|
22
|
+
|
|
19
23
|
# How a run is set up (see Duel::CLI for where each comes from).
|
|
20
24
|
# @api private
|
|
21
25
|
class Settings < Struct[String | Regexp | Integer | Float | bool | Config::ruby | Config::comment | Config::fail_on | nil]
|
|
@@ -31,6 +35,8 @@ module Duel
|
|
|
31
35
|
attr_accessor force: bool
|
|
32
36
|
attr_accessor config_path: String?
|
|
33
37
|
attr_accessor timeout: Float
|
|
38
|
+
# The seconds a run measures for, at most (--time-limit).
|
|
39
|
+
attr_accessor time_limit: Float
|
|
34
40
|
# Each version's Ruby (--ruby), over Config#ruby.
|
|
35
41
|
attr_accessor ruby: Config::ruby
|
|
36
42
|
# When the workflow comments on a pull request (--comment), over
|
|
@@ -49,12 +55,12 @@ module Duel
|
|
|
49
55
|
?Integer processes, ?Float limit, ?Float confidence, ?Float? warm, ?bool force, ?String? config_path,
|
|
50
56
|
?Float timeout, ?Config::ruby ruby, ?Config::comment? comment,
|
|
51
57
|
?Config::fail_on? fail_on, ?String? pushed,
|
|
52
|
-
?String? target) -> instance
|
|
58
|
+
?String? target, ?Float time_limit) -> instance
|
|
53
59
|
| (?base: String?, ?base_dir: String?, ?candidate_dir: String?, ?filter: Regexp, ?jobs: Integer,
|
|
54
60
|
?processes: Integer, ?limit: Float, ?confidence: Float, ?warm: Float?, ?force: bool,
|
|
55
61
|
?config_path: String?, ?timeout: Float, ?ruby: Config::ruby, ?comment: Config::comment?,
|
|
56
62
|
?fail_on: Config::fail_on?, ?pushed: String?,
|
|
57
|
-
?target: String?) -> instance
|
|
63
|
+
?target: String?, ?time_limit: Float) -> instance
|
|
58
64
|
|
|
59
65
|
def self.defaults: () -> Settings
|
|
60
66
|
end
|
|
@@ -68,10 +74,17 @@ module Duel
|
|
|
68
74
|
attr_accessor ruby: String
|
|
69
75
|
attr_accessor env: Hash[String, String?]
|
|
70
76
|
|
|
77
|
+
# What each version's workers are named for: "base" and "head", as
|
|
78
|
+
# long as each other.
|
|
79
|
+
LABELS: Hash[String, String]
|
|
80
|
+
|
|
71
81
|
def self.new: (String name, String root, String ruby, Hash[String, String?] env) -> instance
|
|
72
82
|
|
|
73
83
|
# Each version with nothing prepared: its tree, on the runner's Ruby.
|
|
74
84
|
def self.unprepared: (Config config, Settings settings, String base_root) -> Hash[String, Side]
|
|
85
|
+
|
|
86
|
+
# What its workers, and its version's resources, are named for.
|
|
87
|
+
def label: () -> String
|
|
75
88
|
end
|
|
76
89
|
|
|
77
90
|
# A worker process (Duel::Worker) running one version of the code.
|
|
@@ -476,6 +489,14 @@ module Duel
|
|
|
476
489
|
|
|
477
490
|
@rubies: Hash[String, String]
|
|
478
491
|
@seconds: Float
|
|
492
|
+
@lock: Thread::Mutex
|
|
493
|
+
@started: Float
|
|
494
|
+
@unmeasured: Array[String]
|
|
495
|
+
@unconfirmed: Array[String]
|
|
496
|
+
@across_cut: bool
|
|
497
|
+
|
|
498
|
+
# What a run cut short at its time limit left undone.
|
|
499
|
+
type cut_short = Hash[String, Array[String] | bool]
|
|
479
500
|
|
|
480
501
|
# Across the board: {metric => verdict}. Set by #run.
|
|
481
502
|
attr_reader across: Hash[String, Across::verdict]
|
|
@@ -486,6 +507,9 @@ module Duel
|
|
|
486
507
|
# The seconds the run took. Set by #run.
|
|
487
508
|
attr_reader seconds: Float
|
|
488
509
|
|
|
510
|
+
# What the run left undone when it reached its time limit, or nil.
|
|
511
|
+
def cut_short: () -> cut_short?
|
|
512
|
+
|
|
489
513
|
def initialize: (Config config, Settings settings, String base_root, ?out: _Output) -> void
|
|
490
514
|
|
|
491
515
|
# Returns the Results.
|
|
@@ -496,6 +520,12 @@ module Duel
|
|
|
496
520
|
|
|
497
521
|
def regressed_across: () -> Array[String]
|
|
498
522
|
|
|
523
|
+
# What a run cut short at its time limit left undone, or nil.
|
|
524
|
+
def cut_short_note: () -> String?
|
|
525
|
+
|
|
526
|
+
# Whether the run has measured for longer than its time limit.
|
|
527
|
+
def out_of_time?: () -> bool
|
|
528
|
+
|
|
499
529
|
# The plugins the configuration used, by name.
|
|
500
530
|
def plugins: () -> Array[Symbol]
|
|
501
531
|
|
|
@@ -520,6 +550,11 @@ module Duel
|
|
|
520
550
|
|
|
521
551
|
def attempt: (Lane lane, String name) -> Result
|
|
522
552
|
|
|
553
|
+
# A benchmark the run reached its time limit before it measured.
|
|
554
|
+
def unmeasured: (String name) -> Result
|
|
555
|
+
|
|
556
|
+
def limit_text: () -> String
|
|
557
|
+
|
|
523
558
|
def confirm: (Array[Result] suspects) -> void
|
|
524
559
|
|
|
525
560
|
def profile: (Array[Result] regressed) -> void
|
data/sig/duel/summary.rbs
CHANGED
|
@@ -70,6 +70,9 @@ module Duel
|
|
|
70
70
|
def compared: () -> String
|
|
71
71
|
|
|
72
72
|
# The benchmarks that failed.
|
|
73
|
+
# What the run left undone at its time limit, if it reached it.
|
|
74
|
+
def cut_short: () -> String?
|
|
75
|
+
|
|
73
76
|
def failures: () -> String?
|
|
74
77
|
|
|
75
78
|
# What got worse, or the error's first line.
|