Browse Source

[ruby/grape] Update dependencies (#9689)

Also increase the connection pool to 3 (similar to Rails).

+-------------------------+---------+------+-----+-----+-----+--------------+
|              branch_name|plaintext|update| json|   db|query|weighted_score|
+-------------------------+---------+------+-----+-----+-----+--------------+
|                   master|    19841| 10008|57534|25783|13696|          1087|
|grape/update-dependencies|    22286| 10680|58089|28088|17152|          1213|
+-------------------------+---------+------+-----+-----+-----+--------------+
Petrik de Heus 5 months ago
parent
commit
d4acac67b2

+ 3 - 4
frameworks/Ruby/grape/Gemfile

@@ -2,8 +2,7 @@ source 'https://rubygems.org'
 
 
 gem 'mysql2', '0.5.6'
 gem 'mysql2', '0.5.6'
 gem 'unicorn', '6.1.0'
 gem 'unicorn', '6.1.0'
-gem 'puma', '~> 6.4'
-gem 'activerecord', '~> 7.1.0', :require => 'active_record'
+gem 'puma', '~> 6.5'
+gem 'activerecord', '~> 8.0.0', :require => 'active_record'
 gem 'grape', '2.1.1'
 gem 'grape', '2.1.1'
-gem 'multi_json', require: 'multi_json'
-gem 'oj', '~> 3.16'
+gem 'json', '~> 2.9'

+ 3 - 3
frameworks/Ruby/grape/config.ru

@@ -48,13 +48,13 @@ module Acme
     end
     end
 
 
     get '/db' do
     get '/db' do
-      ActiveRecord::Base.connection_pool.with_connection do
+      ActiveRecord::Base.with_connection do
         World.find(rand1).attributes
         World.find(rand1).attributes
       end
       end
     end
     end
 
 
     get '/query' do
     get '/query' do
-      ActiveRecord::Base.connection_pool.with_connection do
+      ActiveRecord::Base.with_connection do
         ALL_IDS.sample(bounded_queries).map do |id|
         ALL_IDS.sample(bounded_queries).map do |id|
           World.find(id)
           World.find(id)
         end
         end
@@ -63,7 +63,7 @@ module Acme
 
 
     get '/updates' do
     get '/updates' do
       worlds =
       worlds =
-        ActiveRecord::Base.connection_pool.with_connection do
+        ActiveRecord::Base.with_connection do
           ALL_IDS.sample(bounded_queries).map do |id|
           ALL_IDS.sample(bounded_queries).map do |id|
             world = World.find(id)
             world = World.find(id)
             new_value = rand1
             new_value = rand1

+ 1 - 1
frameworks/Ruby/grape/config/database.yml

@@ -5,5 +5,5 @@ production:
   database: hello_world
   database: hello_world
   username: benchmarkdbuser
   username: benchmarkdbuser
   password: benchmarkdbpass
   password: benchmarkdbpass
-  pool: 2
+  pool: 3
   timeout: 5000
   timeout: 5000

+ 1 - 1
frameworks/Ruby/grape/config/puma.rb

@@ -5,7 +5,7 @@ num_workers, num_threads = auto_tune
 
 
 workers num_workers
 workers num_workers
 
 
-threads 2, 2
+threads 3, 3
 
 
 # Use the `preload_app!` method when specifying a `workers` number.
 # Use the `preload_app!` method when specifying a `workers` number.
 # This directive tells Puma to first boot the application and load code
 # This directive tells Puma to first boot the application and load code