File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
lib/sentry/rails/log_subscribers
spec/sentry/rails/log_subscribers Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class ActionControllerSubscriber < Sentry::Rails::LogSubscriber
2828 # @param event [ActiveSupport::Notifications::Event] The controller action event
2929 def process_action ( event )
3030 payload = event . payload
31- duration = event . time . round ( 2 )
31+ duration = event . duration . round ( 2 )
3232
3333 controller = payload [ :controller ]
3434 action = payload [ :action ]
Original file line number Diff line number Diff line change 2525 expect ( log_event [ :attributes ] [ :controller ] [ :value ] ) . to eq ( "HelloController" )
2626 expect ( log_event [ :attributes ] [ :action ] [ :value ] ) . to eq ( "world" )
2727 expect ( log_event [ :attributes ] [ :status ] [ :value ] ) . to eq ( 200 )
28- expect ( log_event [ :attributes ] [ :duration_ms ] [ :value ] ) . to be > 0
28+
29+ duration = log_event [ :attributes ] [ :duration_ms ] [ :value ]
30+ expect ( duration ) . to be_a ( Float )
31+ expect ( duration ) . to be_in ( 0.01 ..30.0 )
32+
2933 expect ( log_event [ :attributes ] [ :method ] [ :value ] ) . to eq ( "GET" )
3034 expect ( log_event [ :attributes ] [ :path ] [ :value ] ) . to eq ( "/world" )
3135 expect ( log_event [ :attributes ] [ :format ] [ :value ] ) . to eq ( :html )
You can’t perform that action at this time.
0 commit comments