Skip to content
Open
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
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ end
group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"
gem "log_bench", path: "../log_bench"
gem "log_bench", path: ".."
gem "logstruct"
gem "sidekiq"
gem "redis"
end
Expand Down
13 changes: 11 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../log_bench
remote: ..
specs:
log_bench (0.5.3)
log_bench (0.6.0)
curses (~> 1.5)
lograge (~> 0.14)
net-http (~> 0.6)
Expand Down Expand Up @@ -157,6 +157,11 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
logstruct (0.1.9)
lograge (>= 0.11)
rails (>= 7.1)
semantic_logger (~> 4.15)
sorbet-runtime (>= 0.5)
loofah (2.24.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -315,6 +320,8 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 4.0)
websocket (~> 1.0)
semantic_logger (4.17.0)
concurrent-ruby (~> 1.0)
sidekiq (8.0.10)
connection_pool (>= 2.5.0)
json (>= 2.9.0)
Expand All @@ -337,6 +344,7 @@ GEM
fugit (~> 1.11.0)
railties (>= 7.1)
thor (>= 1.3.1)
sorbet-runtime (0.6.12894)
sqlite3 (2.7.4-aarch64-linux-gnu)
sqlite3 (2.7.4-aarch64-linux-musl)
sqlite3 (2.7.4-arm-linux-gnu)
Expand Down Expand Up @@ -405,6 +413,7 @@ DEPENDENCIES
jbuilder
kamal
log_bench!
logstruct
propshaft
puma (>= 5.0)
rails (~> 8.0.2)
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
class HomeController < ApplicationController
def index
Rails.logger.info "HomeController#index before TestJob at #{Time.now}"

# Run some SQL queries for testing
ActiveRecord::Base.connection.execute("SELECT 1 AS test_query")
ActiveRecord::Base.connection.execute("SELECT sqlite_version()")

TestJob.set(wait: 2.seconds).perform_later
TestSidekiqJob.perform_async
TestSidekiqJob.perform_async if defined?(Sidekiq)
Rails.logger.info "HomeController#index after TestJob at #{Time.now}"
end
end
10 changes: 6 additions & 4 deletions app/sidekiq/test_sidekiq_job.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
class TestSidekiqJob
include Sidekiq::Job
if defined?(Sidekiq)
class TestSidekiqJob
include Sidekiq::Job

def perform(*args)
logger.info "TestSidekiqJob#perform at #{Time.now}"
def perform(*args)
logger.info "TestSidekiqJob#perform at #{Time.now}"
end
end
end
5 changes: 0 additions & 5 deletions config/initializers/log_bench.rb

This file was deleted.

6 changes: 4 additions & 2 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Sidekiq.configure_server do |config|
config.logger = Rails.logger
if defined?(Sidekiq)
Sidekiq.configure_server do |config|
config.logger = Rails.logger
end
end
2 changes: 1 addition & 1 deletion test/controllers/home_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class HomeControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get home_index_url
get root_url
assert_response :success
end
end