def self.subscribe
new.
subscribe("meta_request.log").
subscribe("sql.active_record", &SQL_BLOCK).
subscribe("sql.sequel", &SQL_BLOCK).
subscribe("render_partial.action_view").
subscribe("render_template.action_view").
subscribe("process_action.action_controller.exception").
subscribe("process_action.action_controller") do |*args|
name, start, ending, transaction_id, payload = args
payload[:status] = '500' if payload[:exception]
Event.new(name, start, ending, transaction_id, payload)
end.
subscribe("cache_read.active_support", &CACHE_BLOCK).
subscribe("cache_generate.active_support", &CACHE_BLOCK).
subscribe("cache_fetch_hit.active_support", &CACHE_BLOCK).
subscribe("cache_write.active_support", &CACHE_BLOCK).
subscribe("cache_delete.active_support", &CACHE_BLOCK).
subscribe("cache_exist?.active_support", &CACHE_BLOCK)
end