sus-fixtures-benchmark 0.1.0
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 +7 -0
- checksums.yaml.gz.sig +0 -0
- data/agent.md +47 -0
- data/lib/sus/fixtures/benchmark/repeats.rb +39 -0
- data/lib/sus/fixtures/benchmark/sampler.rb +179 -0
- data/lib/sus/fixtures/benchmark/time.rb +59 -0
- data/lib/sus/fixtures/benchmark/version.rb +12 -0
- data/lib/sus/fixtures/benchmark.rb +91 -0
- data/license.md +21 -0
- data/readme.md +41 -0
- data/releases.md +5 -0
- data.tar.gz.sig +0 -0
- metadata +92 -0
- metadata.gz.sig +3 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 63078795b33d87a934f27e4b1a3499b67a5a1dbc3d4fb9c50cc83a3014dc9916
|
4
|
+
data.tar.gz: c2c82e5e602dfd1f3a2e9f27609cbd518fc8822b70da8bb226a606bd9f6de06a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a7fb2ab5b00ab5061b5fee54bb1bdfe0587ec6e95f811eca1b49e914a3511c0f7da13dbabe861b30c797c476c65577d3eb4200243cd2557ce19083b25269ab0a
|
7
|
+
data.tar.gz: 96a95d1c1e20585ff56e82035b0819f0c40cb967436ef32837bc389e67524b318e7e04b2ac863f55d172f8e108151e2850de2d169d4b36b10e796514ddb626a4
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data/agent.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Agent
|
2
|
+
|
3
|
+
## Context
|
4
|
+
|
5
|
+
This section provides links to documentation from installed packages. It is automatically generated and may be updated by running `bake agent:context:install`.
|
6
|
+
|
7
|
+
**Important:** Before performing any code, documentation, or analysis tasks, always read and apply the full content of any relevant documentation referenced in the following sections. These context files contain authoritative standards and best practices for documentation, code style, and project-specific workflows. **Do not proceed with any actions until you have read and incorporated the guidance from relevant context files.**
|
8
|
+
|
9
|
+
### agent-context
|
10
|
+
|
11
|
+
Install and manage context files from Ruby gems.
|
12
|
+
|
13
|
+
#### [Usage Guide](.context/agent-context/usage.md)
|
14
|
+
|
15
|
+
`agent-context` is a tool that helps you discover and install contextual information from Ruby gems for AI agents. Gems can provide additional documentation, examples, and guidance in a `context/` ...
|
16
|
+
|
17
|
+
### decode
|
18
|
+
|
19
|
+
Code analysis for documentation generation.
|
20
|
+
|
21
|
+
#### [Getting Started with Decode](.context/decode/getting-started.md)
|
22
|
+
|
23
|
+
The Decode gem provides programmatic access to Ruby code structure and metadata. It can parse Ruby files and extract definitions, comments, and documentation pragmas, enabling code analysis, docume...
|
24
|
+
|
25
|
+
#### [Documentation Coverage](.context/decode/coverage.md)
|
26
|
+
|
27
|
+
This guide explains how to test and monitor documentation coverage in your Ruby projects using the Decode gem's built-in bake tasks.
|
28
|
+
|
29
|
+
#### [Ruby Documentation](.context/decode/ruby-documentation.md)
|
30
|
+
|
31
|
+
This guide covers documentation practices and pragmas supported by the Decode gem for documenting Ruby code. These pragmas provide structured documentation that can be parsed and used to generate A...
|
32
|
+
|
33
|
+
### sus
|
34
|
+
|
35
|
+
A fast and scalable test runner.
|
36
|
+
|
37
|
+
#### [Using Sus Testing Framework](.context/sus/usage.md)
|
38
|
+
|
39
|
+
Sus is a modern Ruby testing framework that provides a clean, BDD-style syntax for writing tests. It's designed to be fast, simple, and expressive.
|
40
|
+
|
41
|
+
#### [Mocking](.context/sus/mocking.md)
|
42
|
+
|
43
|
+
There are two types of mocking in sus: `receive` and `mock`. The `receive` matcher is a subset of full mocking and is used to set expectations on method calls, while `mock` can be used to replace m...
|
44
|
+
|
45
|
+
#### [Shared Test Behaviors and Fixtures](.context/sus/shared.md)
|
46
|
+
|
47
|
+
Sus provides shared test contexts which can be used to define common behaviours or tests that can be reused across one or more test files.
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# Released under the MIT License.
|
5
|
+
# Copyright, 2025, by Samuel Williams.
|
6
|
+
|
7
|
+
require_relative "time"
|
8
|
+
|
9
|
+
module Sus
|
10
|
+
module Fixtures
|
11
|
+
module Benchmark
|
12
|
+
# Represents a benchmarking helper that executes a block multiple times, collecting timing samples until statistical convergence is reached.
|
13
|
+
class Repeats
|
14
|
+
# Initializes a new {Repeats} object with a sampler to collect timing data.
|
15
|
+
# @parameter samples [Sampler] The sampler object to collect timing data.
|
16
|
+
def initialize(samples)
|
17
|
+
@samples = samples
|
18
|
+
end
|
19
|
+
|
20
|
+
# Samples the execution time of the given block and adds the result to the sampler.
|
21
|
+
# @parameter block [Proc] The block to benchmark.
|
22
|
+
private def sample!(block)
|
23
|
+
time = Benchmark::Time.measure do
|
24
|
+
block.call
|
25
|
+
end
|
26
|
+
@samples.add(time.real)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Repeatedly executes the block until the sampler reports convergence.
|
30
|
+
# @parameter block [Proc] The block to benchmark.
|
31
|
+
def times(&block)
|
32
|
+
until @samples.converged?
|
33
|
+
sample!(block)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,179 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2025, by Samuel Williams.
|
5
|
+
|
6
|
+
module Sus
|
7
|
+
module Fixtures
|
8
|
+
module Benchmark
|
9
|
+
# Represents a statistical sampler for benchmarking, collecting timing samples and computing statistics.
|
10
|
+
class Sampler
|
11
|
+
B = [
|
12
|
+
1.570796288, 0.03706987906, -0.8364353589e-3,
|
13
|
+
-0.2250947176e-3, 0.6841218299e-5, 0.5824238515e-5,
|
14
|
+
-0.104527497e-5, 0.8360937017e-7, -0.3231081277e-8,
|
15
|
+
0.3657763036e-10, 0.6936233982e-12
|
16
|
+
]
|
17
|
+
private_constant :B
|
18
|
+
|
19
|
+
# Return the inverse CDF or P-value of the corresponding integral
|
20
|
+
private def quantile(qn)
|
21
|
+
if qn < 0.0 || qn > 1.0
|
22
|
+
raise ArgumentError, "qn must be in the range [0, 1]"
|
23
|
+
end
|
24
|
+
|
25
|
+
# Let's cache the standard normal quantiles for common values:
|
26
|
+
case qn
|
27
|
+
when 0.5
|
28
|
+
return 0.0
|
29
|
+
when 0.95
|
30
|
+
return 1.6448536269514722
|
31
|
+
when 0.96
|
32
|
+
return 1.7506860712521692
|
33
|
+
when 0.97
|
34
|
+
return 1.8807936081512509
|
35
|
+
when 0.98
|
36
|
+
return 2.0537489106318225
|
37
|
+
when 0.99
|
38
|
+
return 2.3263478740408408
|
39
|
+
end
|
40
|
+
|
41
|
+
w1 = qn
|
42
|
+
w3 = -Math.log(4.0 * w1 * (1.0 - w1))
|
43
|
+
w1 = B[0]
|
44
|
+
|
45
|
+
1.upto(10) do |i|
|
46
|
+
w1 += B[i] * w3**i
|
47
|
+
end
|
48
|
+
|
49
|
+
if qn >= 0.5
|
50
|
+
return Math.sqrt(w1 * w3)
|
51
|
+
else
|
52
|
+
return -Math.sqrt(w1 * w3)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Initializes a new {Sampler} object with an optional minimum sample size, confidence level, and margin of error.
|
57
|
+
# @parameter minimum [Integer] The minimum number of samples required before convergence can be determined (default: 8).
|
58
|
+
# @parameter confidence [Float] The confidence level (default: 0.95). If we repeated this measurement process many times, % of the calculated intervals would include the true value we’re trying to estimate.
|
59
|
+
# @parameter margin_of_error [Float] The acceptable margin of error relative to the mean (default: 0.02, e.g. ±2%).
|
60
|
+
def initialize(minimum: 8, confidence: 0.95, margin_of_error: 0.02)
|
61
|
+
@minimum = minimum
|
62
|
+
@confidence = confidence
|
63
|
+
@margin_of_error = margin_of_error
|
64
|
+
|
65
|
+
# Calculate the z-score for the given confidence level:
|
66
|
+
@z_score = quantile((1 + @confidence) / 2.0)
|
67
|
+
|
68
|
+
# Welford's algorithm for calculating mean and variance in a single pass:
|
69
|
+
@count = 0
|
70
|
+
@mean = 0.0
|
71
|
+
@variance_accumulator = 0.0
|
72
|
+
end
|
73
|
+
|
74
|
+
# The minimum number of samples required for convergence.
|
75
|
+
# @returns [Integer]
|
76
|
+
attr :minimum
|
77
|
+
|
78
|
+
# Adds a new timing value to the sample set.
|
79
|
+
# @parameter value [Float] The timing value to add (in seconds).
|
80
|
+
def add(value)
|
81
|
+
@count += 1
|
82
|
+
delta = value - @mean
|
83
|
+
@mean += delta / @count
|
84
|
+
@variance_accumulator += delta * (value - @mean)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Returns the number of samples collected.
|
88
|
+
# @returns [Integer]
|
89
|
+
def size
|
90
|
+
@count
|
91
|
+
end
|
92
|
+
|
93
|
+
# Returns the mean (average) of the collected samples.
|
94
|
+
# @returns [Float]
|
95
|
+
def mean
|
96
|
+
@mean
|
97
|
+
end
|
98
|
+
|
99
|
+
# Returns the variance of the collected samples.
|
100
|
+
# @returns [Float | Nil] Returns nil if not enough samples.
|
101
|
+
def variance
|
102
|
+
if @count > 1
|
103
|
+
@variance_accumulator / (@count)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# Returns the standard deviation of the collected samples.
|
108
|
+
# @returns [Float | Nil] Returns nil if not enough samples.
|
109
|
+
def standard_deviation
|
110
|
+
v = self.variance
|
111
|
+
v ? Math.sqrt(v) : nil
|
112
|
+
end
|
113
|
+
|
114
|
+
# Returns the standard error of the mean for the collected samples.
|
115
|
+
# @returns [Float | Nil] Returns nil if not enough samples.
|
116
|
+
def standard_error
|
117
|
+
sd = self.standard_deviation
|
118
|
+
sd ? sd / Math.sqrt(@count) : nil
|
119
|
+
end
|
120
|
+
|
121
|
+
# Formats a duration in seconds as a human-readable string.
|
122
|
+
# @parameter seconds [Float] The duration in seconds.
|
123
|
+
# @returns [String]
|
124
|
+
private def format_duration(seconds)
|
125
|
+
if seconds.nil?
|
126
|
+
return "N/A"
|
127
|
+
end
|
128
|
+
|
129
|
+
if seconds < 1e-6
|
130
|
+
"#{(seconds * 1e9).round(2)}ns"
|
131
|
+
elsif seconds < 1e-3
|
132
|
+
"#{(seconds * 1e6).round(2)}μs"
|
133
|
+
elsif seconds < 1
|
134
|
+
"#{(seconds * 1e3).round(2)}ms"
|
135
|
+
else
|
136
|
+
"#{seconds.round(2)}s"
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# Returns a summary string of the sample statistics.
|
141
|
+
# @returns [String]
|
142
|
+
def to_s
|
143
|
+
"#{self.size} samples, mean: #{format_duration(self.mean)}, standard deviation: #{format_duration(self.standard_deviation)}, standard error: #{format_duration(self.standard_error)}"
|
144
|
+
end
|
145
|
+
|
146
|
+
# Determines if the sample size has converged based on the confidence level and margin of error.
|
147
|
+
#
|
148
|
+
# Sampling data is always subject to some degree of uncertainty, and we want to ensure that our sample size is sufficient to provide a reliable estimate of the true value we're trying to measure (e.g. the mean execution time of a block).
|
149
|
+
#
|
150
|
+
# The mean of the data is the average of all samples, and the standard error tells us how much the sampled mean is expected to vary from the true value. So a big standard error indicates that the mean is not very reliable, and a small standard error indicates that the mean is more reliable.
|
151
|
+
#
|
152
|
+
# We could use the standard error to compute convergence, but we also want to ensure that the margin of error is within an acceptable range relative to the mean. This is where the confidence level and margin of error come into play. In other words, the margin of error is a relative measure, and we want an absolute measurement by which to determine convergence.
|
153
|
+
#
|
154
|
+
# The typical way to express this is to say that we are "confident" that the true mean is within a certain margin of error relative to the measured mean. For example, if we have a mean of 100 seconds and a margin of error of 0.02, then we are saying that we are confident (with the specified confidence level) that the true mean is within ±2 seconds (2% of the mean) of our measured mean.
|
155
|
+
#
|
156
|
+
# When we say "confident", we are referring to a statistical confidence level, which is a measure of how likely it is that the true value lies within the margin of error if we repeated the benchmark many times. A common confidence level is 95%, which means that if we repeated the measurement process many times, 95% of the calculated intervals would include the true value we’re trying to estimate, in other words, there is a 5% chance that the true value lies outside the margin of error.
|
157
|
+
#
|
158
|
+
# Assuming we are measuring in seconds, this tells us "Based on my current data, I am %confident that the true mean is within ±current_margin_of_error seconds of my measured mean." In other words, increasing the number of samples will make the margin of error smaller for the same confidence level. Given that we are asked to be at least some confidence level, we can calculate whether this is true or not yet (i.e. whether we need to keep sampling).
|
159
|
+
#
|
160
|
+
# The only caveat to this, is that we need to have at least @minimum samples before we can make this determination. If we have less than @minimum samples, we will return false. The reason for this is that we need a minimum number of samples to calculate a meaningful standard error and margin of error.
|
161
|
+
# @returns [Boolean] true if the sample size has converged, false otherwise.
|
162
|
+
def converged?
|
163
|
+
return false if @count < @minimum
|
164
|
+
# Calculate the current mean and standard error
|
165
|
+
mean = self.mean
|
166
|
+
standard_error = self.standard_error
|
167
|
+
if mean && standard_error
|
168
|
+
# Calculate the margin of error:
|
169
|
+
current_margin_of_error = @z_score * standard_error
|
170
|
+
# Normalize the margin of error relative to the mean:
|
171
|
+
relative_margin_of_error = @margin_of_error * mean.abs
|
172
|
+
# Check if the margin of error is within the acceptable range:
|
173
|
+
current_margin_of_error <= relative_margin_of_error
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2025, by Samuel Williams.
|
5
|
+
|
6
|
+
module Sus
|
7
|
+
module Fixtures
|
8
|
+
module Benchmark
|
9
|
+
# Represents a timing sample for benchmarking, including user, system, and real time.
|
10
|
+
class Time
|
11
|
+
# Measures the execution time of a block, returning a new {Time} object with user, system, and real time.
|
12
|
+
# @returns [Time] The measured timing sample.
|
13
|
+
def self.measure
|
14
|
+
t0, r0 = Process.times, Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
15
|
+
yield
|
16
|
+
t1, r1 = Process.times, Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
17
|
+
|
18
|
+
self.new(
|
19
|
+
t1.utime - t0.utime,
|
20
|
+
t1.stime - t0.stime,
|
21
|
+
r1 - r0,
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Initializes a new {Time} object with user, system, and real time values.
|
26
|
+
# @parameter user [Float] The user CPU time in seconds.
|
27
|
+
# @parameter system [Float] The system CPU time in seconds.
|
28
|
+
# @parameter real [Float] The real (wall clock) time in seconds.
|
29
|
+
def initialize(user = 0.0, system = 0.0, real = 0.0)
|
30
|
+
@user = user
|
31
|
+
@system = system
|
32
|
+
@real = real
|
33
|
+
end
|
34
|
+
|
35
|
+
# The user CPU time in seconds.
|
36
|
+
# @returns [Float]
|
37
|
+
attr :user
|
38
|
+
# The system CPU time in seconds.
|
39
|
+
# @returns [Float]
|
40
|
+
attr :system
|
41
|
+
# The real (wall clock) time in seconds.
|
42
|
+
# @returns [Float]
|
43
|
+
attr :real
|
44
|
+
|
45
|
+
# Returns a string representation of the real time in seconds.
|
46
|
+
# @returns [String]
|
47
|
+
def to_s
|
48
|
+
"#{self.real}s"
|
49
|
+
end
|
50
|
+
|
51
|
+
# Returns a detailed string representation of the timing sample.
|
52
|
+
# @returns [String]
|
53
|
+
def inspect
|
54
|
+
"#<#{self.class} user=#{self.user}s system=#{self.system}s real=#{self.real}s>"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2024-2025, by Samuel Williams.
|
5
|
+
|
6
|
+
require_relative "benchmark/version"
|
7
|
+
|
8
|
+
require_relative "benchmark/sampler"
|
9
|
+
require_relative "benchmark/repeats"
|
10
|
+
|
11
|
+
# Provides the top-level namespace for the Sus testing framework.
|
12
|
+
module Sus
|
13
|
+
# Provides reusable fixtures for benchmarking code.
|
14
|
+
module Fixtures
|
15
|
+
# Provides benchmarking utilities for Sus fixtures.
|
16
|
+
module Benchmark
|
17
|
+
# Extends a test context with benchmarking helpers when included.
|
18
|
+
# @parameter base [Class] The test context class to extend.
|
19
|
+
def self.included(base)
|
20
|
+
base.extend(Context)
|
21
|
+
end
|
22
|
+
|
23
|
+
# Provides a benchmarking measure for a test case.
|
24
|
+
module Measure
|
25
|
+
# Builds a new benchmarking measure class for a test case.
|
26
|
+
# @parameter parent [Class] The parent test context class.
|
27
|
+
# @parameter description [String] The description of the measure.
|
28
|
+
# @parameter unique [Boolean] Whether the measure should have a unique identity.
|
29
|
+
# @parameter block [Proc] The block to execute for the measure.
|
30
|
+
# @returns [Class] The new measure class.
|
31
|
+
def self.build(parent, description, unique: true, &block)
|
32
|
+
base = Class.new(parent)
|
33
|
+
base.extend(self)
|
34
|
+
base.description = description
|
35
|
+
base.identity = Identity.nested(parent.identity, base.description, unique: unique)
|
36
|
+
base.set_temporary_name("#{self}[#{description}]")
|
37
|
+
|
38
|
+
if block_given?
|
39
|
+
base.define_method(:run, &block)
|
40
|
+
end
|
41
|
+
|
42
|
+
return base
|
43
|
+
end
|
44
|
+
|
45
|
+
# Returns true if this is a leaf measure.
|
46
|
+
# @returns [Boolean]
|
47
|
+
def leaf?
|
48
|
+
true
|
49
|
+
end
|
50
|
+
|
51
|
+
# Prints the measure description to the output.
|
52
|
+
# @parameter output [IO] The output stream.
|
53
|
+
def print(output)
|
54
|
+
self.superclass.print(output)
|
55
|
+
output.write(" measure ", :it, self.description, :reset, " ", :identity, self.identity.to_s, :reset)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Returns a string representation of the measure.
|
59
|
+
# @returns [String]
|
60
|
+
def to_s
|
61
|
+
"measure #{self.description}"
|
62
|
+
end
|
63
|
+
|
64
|
+
# Executes the measure within the given assertions context.
|
65
|
+
# @parameter assertions [Object] The assertions context.
|
66
|
+
def call(assertions)
|
67
|
+
assertions.nested(self, identity: self.identity, isolated: true, measure: true) do |assertions|
|
68
|
+
instance = self.new(assertions)
|
69
|
+
|
70
|
+
samples = Sampler.new
|
71
|
+
repeats = Repeats.new(samples)
|
72
|
+
|
73
|
+
instance.around do
|
74
|
+
instance.run(repeats)
|
75
|
+
end
|
76
|
+
|
77
|
+
assertions.inform(samples.to_s)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Provides benchmarking helpers for test contexts.
|
83
|
+
module Context
|
84
|
+
# Measures the execution time of a block and adds a benchmarking measure to the context.
|
85
|
+
def measure(...)
|
86
|
+
add Measure.build(self, ...)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
data/license.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# MIT License
|
2
|
+
|
3
|
+
Copyright, 2024-2025, by Samuel Williams.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/readme.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Sus::Fixtures::Benchmark
|
2
|
+
|
3
|
+
Provides fixtures for sus for running benchmarks.
|
4
|
+
|
5
|
+
[](https://github.com/socketry/sus-fixtures-benchmark/actions?workflow=Test)
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
``` bash
|
10
|
+
bundle add sus-fixtures-benchmark
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
Please see the [project documentation](https://suspecting.github.io/sus-fixtures-benchmark/) for more details.
|
16
|
+
|
17
|
+
## Releases
|
18
|
+
|
19
|
+
Please see the [project releases](https://suspecting.github.io/sus-fixtures-benchmark/releases/index) for all releases.
|
20
|
+
|
21
|
+
### v0.1.0
|
22
|
+
|
23
|
+
- Added `Sus::Fixtures::Benchmark::Repeats` which is not an integer, but an instance that allows the block to be executed multiple times until the benchmark converges.
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
We welcome contributions to this project.
|
28
|
+
|
29
|
+
1. Fork it.
|
30
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
31
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
32
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
33
|
+
5. Create new Pull Request.
|
34
|
+
|
35
|
+
### Developer Certificate of Origin
|
36
|
+
|
37
|
+
In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
|
38
|
+
|
39
|
+
### Community Guidelines
|
40
|
+
|
41
|
+
This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.
|
data/releases.md
ADDED
data.tar.gz.sig
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sus-fixtures-benchmark
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Samuel Williams
|
8
|
+
bindir: bin
|
9
|
+
cert_chain:
|
10
|
+
- |
|
11
|
+
-----BEGIN CERTIFICATE-----
|
12
|
+
MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
|
13
|
+
ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
|
14
|
+
CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
|
15
|
+
MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
|
16
|
+
MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
|
17
|
+
bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
|
18
|
+
igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
|
19
|
+
9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW
|
20
|
+
sGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPfaJOglovdxf7dgsHz67Xgd/ka+Wo1YqoE
|
21
|
+
e5AUKRwUuvaUaumAKgPH+4E4oiLXI4T1Ff5Q7xxv6yXvHuYtlMHhYfgNn8iiW8WN
|
22
|
+
XibYXPNP7NtieSQqwR/xM6IRSoyXKuS+ZNGDPUUGk8RoiV/xvVN4LrVm9upSc0ss
|
23
|
+
RZ6qwOQmXCo/lLcDUxJAgG95cPw//sI00tZan75VgsGzSWAOdjQpFM0l4dxvKwHn
|
24
|
+
tUeT3ZsAgt0JnGqNm2Bkz81kG4A2hSyFZTFA8vZGhp+hz+8Q573tAR89y9YJBdYM
|
25
|
+
zp0FM4zwMNEUwgfRzv1tEVVUEXmoFCyhzonUUw4nE4CFu/sE3ffhjKcXcY//qiSW
|
26
|
+
xm4erY3XAgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
27
|
+
BBYEFO9t7XWuFf2SKLmuijgqR4sGDlRsMC4GA1UdEQQnMCWBI3NhbXVlbC53aWxs
|
28
|
+
aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWBI3NhbXVlbC53aWxs
|
29
|
+
aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEBCwUAA4IBgQB5sxkE
|
30
|
+
cBsSYwK6fYpM+hA5B5yZY2+L0Z+27jF1pWGgbhPH8/FjjBLVn+VFok3CDpRqwXCl
|
31
|
+
xCO40JEkKdznNy2avOMra6PFiQyOE74kCtv7P+Fdc+FhgqI5lMon6tt9rNeXmnW/
|
32
|
+
c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp
|
33
|
+
8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
|
34
|
+
JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
|
35
|
+
eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
|
36
|
+
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
37
|
+
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
38
|
+
-----END CERTIFICATE-----
|
39
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
40
|
+
dependencies:
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sus
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.31'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.31'
|
55
|
+
executables: []
|
56
|
+
extensions: []
|
57
|
+
extra_rdoc_files: []
|
58
|
+
files:
|
59
|
+
- agent.md
|
60
|
+
- lib/sus/fixtures/benchmark.rb
|
61
|
+
- lib/sus/fixtures/benchmark/repeats.rb
|
62
|
+
- lib/sus/fixtures/benchmark/sampler.rb
|
63
|
+
- lib/sus/fixtures/benchmark/time.rb
|
64
|
+
- lib/sus/fixtures/benchmark/version.rb
|
65
|
+
- license.md
|
66
|
+
- readme.md
|
67
|
+
- releases.md
|
68
|
+
homepage: https://github.com/suspecting/sus-fixtures-benchmark
|
69
|
+
licenses:
|
70
|
+
- MIT
|
71
|
+
metadata:
|
72
|
+
documentation_uri: https://suspecting.github.io/sus-fixtures-benchmark/
|
73
|
+
funding_uri: https://github.com/sponsors/ioquatix/
|
74
|
+
source_code_uri: https://github.com/suspecting/sus-fixtures-benchmark.git
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.2'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubygems_version: 3.6.7
|
90
|
+
specification_version: 4
|
91
|
+
summary: Test fixtures for benchmarking.
|
92
|
+
test_files: []
|
metadata.gz.sig
ADDED