Skip to content

Commit

Permalink
Merge pull request #936 from airbrake/rails-breakdown-rounding-error-fix
Browse files Browse the repository at this point in the history
rails/breakdown_subscriber: maintain precision
  • Loading branch information
kyrylo committed Mar 12, 2019
2 parents 99b9e33 + 8375e9b commit fa48585
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Airbrake Changelog

### master

* Fixed the Rails performance breakdown hook not maintaining performance
precision ([#936](https://github.com/airbrake/airbrake/pull/936))

### [v8.3.1][v8.3.1] (March 11, 2019)

* Fixes `TypeError` in the `ActionControllerPerformanceBreakdownSubscriber` when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def call(*args)
route: route,
response_type: payload[:format],
groups: {
db: payload[:db_runtime].to_i,
view: payload[:view_runtime].to_i
db: payload[:db_runtime] || 0,
view: payload[:view_runtime] || 0
},
start_time: event.time
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
OpenStruct.new(
payload: {
format: :html,
view_runtime: 1.0,
db_runtime: 1.0
view_runtime: 0.5,
db_runtime: 0.5
}
)
end
Expand All @@ -46,7 +46,7 @@
route: '/test-route',
method: 'GET',
response_type: :html,
groups: { db: 1.0, view: 1.0 }
groups: { db: 0.5, view: 0.5 }
)
)
subject.call([])
Expand All @@ -61,7 +61,7 @@
route: '/test-route',
method: 'GET',
response_type: :html,
groups: { db: 1.0, view: 0 }
groups: { db: 0.5, view: 0 }
)
)
subject.call([])
Expand All @@ -77,7 +77,7 @@
route: '/test-route',
method: 'GET',
response_type: :html,
groups: { db: 0, view: 1.0 }
groups: { db: 0, view: 0.5 }
)
)
subject.call([])
Expand Down

0 comments on commit fa48585

Please sign in to comment.