diff --git a/lib/locomotive/steam/middlewares/logging.rb b/lib/locomotive/steam/middlewares/logging.rb index c319e7ad..fd372db0 100644 --- a/lib/locomotive/steam/middlewares/logging.rb +++ b/lib/locomotive/steam/middlewares/logging.rb @@ -19,6 +19,14 @@ def call(env) app.call(env).tap do |response| done_in_ms = ((Time.now - now) * 10000).truncate / 10.0 log "Completed #{code_to_human(response.first)} in #{done_in_ms}ms\n\n".green + + ActiveSupport::Notifications.instrument('steam.http.render', { + site_id: env['steam.site']&._id, + domain: env['SERVER_NAME'], + path: env['PATH_INFO'], + status: response.first, + time_in_ms: done_in_ms + }) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index dde0188d..b047f18b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -27,6 +27,8 @@ require_relative '../lib/locomotive/steam' require_relative 'support' +ActiveSupport.to_time_preserves_timezone = true + Locomotive::Steam.configure do |config| config.mode = :test end