rails_benchmark_suite 0.2.0 → 0.2.1
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/lib/rails_benchmark_suite/db_setup.rb +0 -13
- data/lib/rails_benchmark_suite/version.rb +1 -1
- data/lib/rails_benchmark_suite.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a480bafc3f61da8710cfa5cf32a5d7923ff58ef34e6df3eca0255213d88c0ce6
|
|
4
|
+
data.tar.gz: e074a613956629715f2dc67da36c105b75ee9a1adb77338f077e741cc9d62ece
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ab14d38074972f11726e8c7d9fff7663c0fb7e5da300a521c67e5a469c6a4bba23d64c658a55796bf2b6f9dd65627cee855d454e1a4f12847151281c3bc6559e
|
|
7
|
+
data.tar.gz: 82730664fbe2515ccbd75e496debc1ac2f93fe0dbbe38a08f43e01b7c1b4ba341336b1d0876db4bb450404a568408e70d244dcc6f98132cce63a94e180466812
|
|
@@ -5,16 +5,3 @@ require "sqlite3"
|
|
|
5
5
|
|
|
6
6
|
# Silence ActiveRecord logs during benchmarks to avoid IO bottlenecks
|
|
7
7
|
ActiveRecord::Base.logger = nil
|
|
8
|
-
|
|
9
|
-
# Setup In-Memory SQLite globally for all suites
|
|
10
|
-
# storage_config = ActiveRecord::DatabaseConfigurations::HashConfig.new("test", "sqlite3", { adapter: "sqlite3", database: ":memory:" })
|
|
11
|
-
# Use shared cache to allow threads to see the same in-memory database
|
|
12
|
-
# Skip internal database setup if running within a Rails application
|
|
13
|
-
unless defined?(Rails)
|
|
14
|
-
ActiveRecord::Base.establish_connection(
|
|
15
|
-
adapter: "sqlite3",
|
|
16
|
-
database: "file:rails_benchmark_suite_mem?mode=memory&cache=shared",
|
|
17
|
-
pool: 20,
|
|
18
|
-
timeout: 10000
|
|
19
|
-
)
|
|
20
|
-
end
|
|
@@ -18,6 +18,14 @@ module RailsBenchmarkSuite
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def self.run(json: false)
|
|
21
|
+
# Enforce database isolation: Always use in-memory SQLite, ignoring host app DB
|
|
22
|
+
ActiveRecord::Base.establish_connection(
|
|
23
|
+
adapter: "sqlite3",
|
|
24
|
+
database: "file:rails_benchmark_suite_mem?mode=memory&cache=shared",
|
|
25
|
+
pool: 20,
|
|
26
|
+
timeout: 10000
|
|
27
|
+
)
|
|
28
|
+
|
|
21
29
|
# Load Schema
|
|
22
30
|
RailsBenchmarkSuite::Schema.load
|
|
23
31
|
|