Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frameworks/Ruby/rage/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

gem "rage-rb", "~> 1.3"
gem "rage-rb", "~> 1.10"

gem "pg", "~> 1.0"
gem "activerecord", "~> 7.2.0", require: "active_record"
Expand Down
4 changes: 0 additions & 4 deletions frameworks/Ruby/rage/app/models/fortune.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
class Fortune < ApplicationRecord
self.table_name = "Fortune"

def as_json(*)
attributes
end
end
4 changes: 0 additions & 4 deletions frameworks/Ruby/rage/app/models/world.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
class World < ApplicationRecord
self.table_name = "World"

def as_json(*)
attributes
end

alias_attribute(:randomNumber, :randomnumber)
end
1 change: 0 additions & 1 deletion frameworks/Ruby/rage/config.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require_relative "config/application"

run Rage.application
Rage.load_middlewares(self)
15 changes: 3 additions & 12 deletions frameworks/Ruby/rage/config/initializers/activerecord.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@

require "etc"

connection = {
adapter: "postgresql",
host: "tfb-database",
username: "benchmarkdbuser",
password: "benchmarkdbpass",
database: "hello_world",
reaping_frequency: 0,
pool: (2 * Math.log(256 / Etc.nprocessors)).floor
}
pool_size = (2 * Math.log(256 / Etc.nprocessors)).floor
puts "ActiveRecord pool size: #{pool_size}"

puts "ActiveRecord connection options: #{connection.inspect}"

ActiveRecord::Base.establish_connection(connection)
ENV["DATABASE_URL"]="postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world?pool=#{pool_size}&reaping_frequency=0"
1 change: 0 additions & 1 deletion frameworks/Ruby/rage/rage.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RUN bundle install --jobs=8
COPY . /rage

ENV RUBY_YJIT_ENABLE=1
ENV RAGE_PATCH_AR_POOL=1
ENV BUNDLE_FORCE_RUBY_PLATFORM=true

CMD bundle exec rage s -b 0.0.0.0 -p 8080 -e production
Loading