Sha256: ab54428bde4fce91586dcbe1eab432c0be343aad4f612b371b89d8164f621387
Contents?: true
Size: 818 Bytes
Versions: 17
Compression:
Stored size: 818 Bytes
Contents
module Librato module Rails module Subscribers # Render operations %w{partial template}.each do |metric| ActiveSupport::Notifications.subscribe "render_#{metric}.action_view" do |*args| event = ActiveSupport::Notifications::Event.new(*args) path = event.payload[:identifier].split('/views/', 2) if path[1] source = path[1].gsub('/', ':') # trim leading underscore for partial sources source.gsub!(':_', ':') if metric == 'partial' collector.group "rails.view" do |c| c.increment "render_#{metric}", source: source, sporadic: true c.timing "render_#{metric}.time", event.duration, source: source, sporadic: true end end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems