class Speedup::Collectors::BulletCollector
Public Class Methods
new(*attrs)
click to toggle source
Calls superclass method
# File lib/speedup/collectors/bullet_collector.rb, line 5 def initialize(*attrs) require 'bullet' Bullet.enable = true super end
Public Instance Methods
event_to_data(notification)
click to toggle source
use this method to keep convention
# File lib/speedup/collectors/bullet_collector.rb, line 37 def event_to_data(notification) {type: notification.class.name.split('::').last, name: notification.title, caller: notification.send(:call_stack_messages), message: notification.body} end
parse_options()
click to toggle source
# File lib/speedup/collectors/bullet_collector.rb, line 12 def parse_options # pass end
results()
click to toggle source
The data results that are inserted at the end of the request for use in deferred placeholders in the Peek the bar.
Returns Hash.
# File lib/speedup/collectors/bullet_collector.rb, line 20 def results {} end
setup_subscribes()
click to toggle source
# File lib/speedup/collectors/bullet_collector.rb, line 24 def setup_subscribes before_request do Bullet.start_request end after_request do Bullet.notification_collector && Bullet.notification_collector.collection.each do |notification| store_event(notification) end Bullet.end_request end end