lib/influxdb/rails/middleware/render_subscriber.rb in influxdb-rails-1.0.0.beta3 vs lib/influxdb/rails/middleware/render_subscriber.rb in influxdb-rails-1.0.0.beta4
- old
+ new
@@ -2,10 +2,16 @@
module InfluxDB
module Rails
module Middleware
class RenderSubscriber < SimpleSubscriber # :nodoc:
+ def short_hook_name
+ return "render_template" if hook_name.include?("render_template")
+ return "render_partial" if hook_name.include?("render_partial")
+ return "render_collection" if hook_name.include?("render_collection")
+ end
+
private
def values(started, finished, payload)
super(started, finished, payload).merge(
count: payload[:count],
@@ -14,9 +20,10 @@
end
def tags(payload)
tags = {
location: location,
+ hook: short_hook_name,
filename: payload[:identifier],
}
super(tags)
end
end