Skip to content
Permalink
Browse files

Type coersion for the win!

  • Loading branch information...
thesecretmaster committed Mar 19, 2019
1 parent 786d5b8 commit eaf6f4cb26585e38e011f6928df2c47477f0310f
Showing with 2 additions and 0 deletions.
  1. +2 −0 config/initializers/redis_logging.rb
@@ -8,6 +8,8 @@
def log_timestamps(ts, status:, action:, controller:, format:, method:, view_runtime:, db_runtime:, path:, uuid:)
# rubocop:enable Metrics/ParameterLists
redis = redis(logger: true)
view_runtime = view_runtime.to_f
db_runtime = db_runtime.to_f
return if path.nil?
path = Rails.sensible_routes.match_for(path)&.path || path.split('?').first
redis.zadd "request_timings/view/by_path/#{method.upcase}/#{path}.#{format}", ts, view_runtime

0 comments on commit eaf6f4c

Please sign in to comment.
You can’t perform that action at this time.