diff options
author | ThibG <thib@sitedethib.com> | 2019-07-07 22:26:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-07 22:26:10 +0200 |
commit | fce885f271f8651702d606406e21677280071e40 (patch) | |
tree | 2ebb76c77088edf0662ef333523ef0f0a03b6c4e /config | |
parent | e5f4d83e60305e2f502f18f507ad79d8fbccfe77 (diff) | |
parent | 5ff9970c8d4acfb69b4696a3b5ce8e2a9580e370 (diff) |
Merge pull request #1152 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/instrumentation.rb | 18 | ||||
-rw-r--r-- | config/initializers/statsd.rb | 6 | ||||
-rw-r--r-- | config/routes.rb | 2 |
3 files changed, 3 insertions, 23 deletions
diff --git a/config/initializers/instrumentation.rb b/config/initializers/instrumentation.rb deleted file mode 100644 index 8483f2be2..000000000 --- a/config/initializers/instrumentation.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -instrumentation_hostname = ENV.fetch('INSTRUMENTATION_HOSTNAME') { 'localhost' } - -ActiveSupport::Notifications.subscribe(/process_action.action_controller/) do |*args| - event = ActiveSupport::Notifications::Event.new(*args) - controller = event.payload[:controller] - action = event.payload[:action] - format = event.payload[:format] || 'all' - format = 'all' if format == '*/*' - status = event.payload[:status] - key = "#{controller}.#{action}.#{format}.#{instrumentation_hostname}" - - ActiveSupport::Notifications.instrument :performance, action: :measure, measurement: "#{key}.total_duration", value: event.duration - ActiveSupport::Notifications.instrument :performance, action: :measure, measurement: "#{key}.db_time", value: event.payload[:db_runtime] - ActiveSupport::Notifications.instrument :performance, action: :measure, measurement: "#{key}.view_time", value: event.payload[:view_runtime] - ActiveSupport::Notifications.instrument :performance, measurement: "#{key}.status.#{status}" -end diff --git a/config/initializers/statsd.rb b/config/initializers/statsd.rb index ce83fd9de..93ea1d1e4 100644 --- a/config/initializers/statsd.rb +++ b/config/initializers/statsd.rb @@ -3,10 +3,10 @@ if ENV['STATSD_ADDR'].present? host, port = ENV['STATSD_ADDR'].split(':') - statsd = ::Statsd.new(host, port) - statsd.namespace = ENV.fetch('STATSD_NAMESPACE') { ['Mastodon', Rails.env].join('.') } + $statsd = ::Statsd.new(host, port) + $statsd.namespace = ENV.fetch('STATSD_NAMESPACE') { ['Mastodon', Rails.env].join('.') } - ::NSA.inform_statsd(statsd) do |informant| + ::NSA.inform_statsd($statsd) do |informant| informant.collect(:action_controller, :web) informant.collect(:active_record, :db) informant.collect(:active_support_cache, :cache) diff --git a/config/routes.rb b/config/routes.rb index 05bcaf9e2..1b88fe5e3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -299,7 +299,6 @@ Rails.application.routes.draw do member do get :context - get :card end end @@ -362,7 +361,6 @@ Rails.application.routes.draw do resources :notifications, only: [:index, :show, :destroy] do collection do post :clear - post :dismiss # Deprecated delete :destroy_multiple end |