about summary refs log tree commit diff
path: root/config/initializers/instrumentation.rb
diff options
context:
space:
mode:
authorReverite <github@reverite.sh>2019-07-07 16:25:42 -0700
committerReverite <github@reverite.sh>2019-07-07 16:25:42 -0700
commit7d99f12fd03cf2f861d0747c3bbcd4a8cf454d99 (patch)
tree7b166c33fefb4bf3cc6f6dee46f5883f7428d80a /config/initializers/instrumentation.rb
parent100bb17b1317f07c0eaa89da869f960b6cff611f (diff)
parentfce885f271f8651702d606406e21677280071e40 (diff)
Merge branch 'glitch' into production
Diffstat (limited to 'config/initializers/instrumentation.rb')
-rw-r--r--config/initializers/instrumentation.rb18
1 files changed, 0 insertions, 18 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