Skip to content

Commit

Permalink
Merge pull request #1 from OneSignal/drop_db_runtime
Browse files Browse the repository at this point in the history
 Do not populate db_runtime metrics and drop buckets above 60s
  • Loading branch information
nicolasvan authored Dec 11, 2024
2 parents 4a53d07 + 0d2770a commit 0bc4fb6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ You always can add support for your app server to [lib/yabeda/rails/railtie.rb](

- Total web requests received: `rails_requests_total`
- Web request duration: `rails_request_duration` (in seconds)
- DB request duration: `rails_db_runtime` (in seconds)


## Hooks
Expand Down
7 changes: 1 addition & 6 deletions lib/yabeda/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Yabeda
module Rails
LONG_RUNNING_REQUEST_BUCKETS = [
0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, # standard
30, 60, 120, 300, 600, # Sometimes requests may be really long-running
30, 60, # We timeout requests at 100s. Requests taking more than 60s will end up in the Infinity bucket
].freeze

class << self
Expand Down Expand Up @@ -40,10 +40,6 @@ def install!
buckets: LONG_RUNNING_REQUEST_BUCKETS,
comment: "A histogram of the response latency."

histogram :db_runtime, unit: :seconds, buckets: LONG_RUNNING_REQUEST_BUCKETS,
comment: "A histogram of the activerecord execution time.",
tags: %i[controller action status format method]

if config.apdex_target
gauge :apdex_target, unit: :seconds,
comment: "Tolerable time for Apdex (T value: maximum duration of satisfactory request)"
Expand All @@ -55,7 +51,6 @@ def install!

rails_requests_total.increment(event.labels)
rails_request_duration.measure(event.labels, event.duration)
rails_db_runtime.measure(event.labels, event.db_runtime)

Yabeda::Rails.controller_handlers.each do |handler|
handler.call(event, event.labels)
Expand Down
4 changes: 0 additions & 4 deletions lib/yabeda/rails/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ def duration
ms2s super
end

def db_runtime
ms2s payload[:db_runtime]
end

private

def controller
Expand Down

0 comments on commit 0bc4fb6

Please sign in to comment.