rails_benchmark_suite 0.3.1 → 0.3.2
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 +7 -0
- data/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/lib/rails_benchmark_suite/reporter.rb +7 -2
- data/lib/rails_benchmark_suite/templates/report.html.erb +1 -1
- data/lib/rails_benchmark_suite/version.rb +1 -1
- data/lib/rails_benchmark_suite/workload_runner.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52350ff4b60a92bb839f96eb8d5032df181fb8578c12ea72afd42ede82f89a43
|
|
4
|
+
data.tar.gz: 6191dfad41045b1b3035a4482a32aa1fc18b560d1b1903282081e28e400fe7c8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a5965daecea7f9044a77e7232a2d838a1b1aca81a96ef27043f1238cc1f946e7b2abca48537668bcc4dd743861f9985592a000c1230fa284c3627659d373906
|
|
7
|
+
data.tar.gz: b191d19713a1ae9821bac379007284c84de10c2994e1165ef648f188c363b2167f89105917911f0d2ca6ca4d716f44150b156aa5ff50c76e969aca55897ab1b6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [0.3.2] - 2026-01-05
|
|
3
|
+
### Refactoring & Polish
|
|
4
|
+
- **DRY Logic**: Centralized "Efficiency" calculation; removed duplicate math from HTML templates.
|
|
5
|
+
- **Responsive UI**: Terminal output now adapts to screen width (instead of hardcoded 84 chars).
|
|
6
|
+
- **Tests**: Added unit tests for HTML Reporter generation.
|
|
7
|
+
- **Docs**: Improved formatting of the Command Line Options table.
|
|
8
|
+
|
|
2
9
|
## [0.3.1] - 2026-01-04
|
|
3
10
|
*Major Architectural Repair & TTY Overhaul*
|
|
4
11
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -120,10 +120,10 @@ bundle exec rails_benchmark_suite --profile --html
|
|
|
120
120
|
|
|
121
121
|
| Flag | Description |
|
|
122
122
|
| :--- | :--- |
|
|
123
|
-
| `--html` | Generates a visual dashboard (`tmp/rails_benchmark_report.html`)
|
|
124
|
-
| `--profile` | **Diagnostic Mode.** Runs
|
|
125
|
-
| `--db` |
|
|
126
|
-
| `-t [N]` | Manually set
|
|
123
|
+
| `--html` | Generates a visual dashboard (`tmp/rails_benchmark_report.html`).<br>**Best used with `--profile`.** |
|
|
124
|
+
| `--profile` | **Diagnostic Mode.** Runs benchmark twice (1T vs MaxT) to calc efficiency.<br>Required for "Scaling Curve". |
|
|
125
|
+
| `--db` | Connects to local `config/database.yml` (Postgres/MySQL).<br>Bypasses in-memory SQLite. |
|
|
126
|
+
| `-t [N]` | Manually set thread count.<br>(Default: Auto-detects CPU cores). |
|
|
127
127
|
|
|
128
128
|
### Configuration Flags
|
|
129
129
|
- `--json`: Output results in JSON format
|
|
@@ -5,6 +5,7 @@ require "tty-table"
|
|
|
5
5
|
require "tty-box"
|
|
6
6
|
require "pastel"
|
|
7
7
|
require "tty-cursor"
|
|
8
|
+
require "tty-screen"
|
|
8
9
|
|
|
9
10
|
module RailsBenchmarkSuite
|
|
10
11
|
module Reporter
|
|
@@ -42,8 +43,10 @@ module RailsBenchmarkSuite
|
|
|
42
43
|
"DB: #{info[:db_mode] || 'SQLite (Memory)'} | YJIT: #{yjit_status}#{yjit_hint}"
|
|
43
44
|
].join("\n")
|
|
44
45
|
|
|
46
|
+
box_width = [TTY::Screen.width, 84].min
|
|
47
|
+
|
|
45
48
|
print TTY::Box.frame(
|
|
46
|
-
width:
|
|
49
|
+
width: box_width,
|
|
47
50
|
title: { top_left: " Rails Benchmark Suite v#{RailsBenchmarkSuite::VERSION} " },
|
|
48
51
|
padding: 1,
|
|
49
52
|
style: {
|
|
@@ -179,8 +182,10 @@ module RailsBenchmarkSuite
|
|
|
179
182
|
score_str = "#{score.round(0)}"
|
|
180
183
|
puts ""
|
|
181
184
|
|
|
185
|
+
box_width = [TTY::Screen.width, 84].min
|
|
186
|
+
|
|
182
187
|
print TTY::Box.frame(
|
|
183
|
-
width:
|
|
188
|
+
width: box_width,
|
|
184
189
|
height: 5,
|
|
185
190
|
align: :center,
|
|
186
191
|
padding: 1,
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
ips_mt = entry_mt ? entry_mt.ips : 0
|
|
103
103
|
|
|
104
104
|
scaling = ips_1t > 0 ? (ips_mt / ips_1t) : 0
|
|
105
|
-
efficiency =
|
|
105
|
+
efficiency = res[:efficiency] || 0.0
|
|
106
106
|
|
|
107
107
|
eff_color = efficiency > 75 ? 'efficiency-high' : (efficiency > 50 ? 'efficiency-med' : 'efficiency-low')
|
|
108
108
|
scale_color = scaling >= 1.0 ? 'text-success' : 'text-danger'
|
|
@@ -61,6 +61,16 @@ module RailsBenchmarkSuite
|
|
|
61
61
|
results.each do |r|
|
|
62
62
|
base_weight = BASE_WEIGHTS[r[:name]] || 1.0
|
|
63
63
|
r[:adjusted_weight] = base_weight / weight_pool
|
|
64
|
+
|
|
65
|
+
# Calculate Efficiency (DRY)
|
|
66
|
+
entries = r[:report].entries
|
|
67
|
+
entry_mt = entries.find { |e| e.label.include?("(#{@threads} threads)") }
|
|
68
|
+
entry_1t = entries.find { |e| e.label.include?("(1 thread)") }
|
|
69
|
+
|
|
70
|
+
ips_mt = entry_mt ? entry_mt.ips : 0
|
|
71
|
+
ips_1t = entry_1t ? entry_1t.ips : 0
|
|
72
|
+
|
|
73
|
+
r[:efficiency] = (ips_1t > 0) ? (ips_mt / (ips_1t * @threads)) * 100 : 0.0
|
|
64
74
|
end
|
|
65
75
|
|
|
66
76
|
# Calculate total score
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_benchmark_suite
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RailsBenchmarkSuite Contributors
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-01-
|
|
10
|
+
date: 2026-01-06 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: benchmark-ips
|