Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to customize the bucket sizing for histograms #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/yabeda/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def on_controller_action(&block)
def install!
Yabeda.configure do
config = ::Yabeda::Rails.config
buckets = config.buckets || LONG_RUNNING_REQUEST_BUCKETS

group :rails

Expand All @@ -37,14 +38,14 @@ def install!

histogram :request_duration, tags: %i[controller action status format method],
unit: :seconds,
buckets: LONG_RUNNING_REQUEST_BUCKETS,
buckets: buckets,
comment: "A histogram of the response latency."

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

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

Expand Down
1 change: 1 addition & 0 deletions lib/yabeda/rails/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Config < ::Anyway::Config
config_name :yabeda_rails

attr_config :apdex_target
attr_config :buckets
attr_config controller_name_case: :snake
end
end
Expand Down