提交 c6af7646 编写于 作者: A Aaron Patterson

listeners are per thread, so remove nested hash

上级 ceba010e
......@@ -87,9 +87,7 @@ def flush_all!
end
def initialize
@event_stack = Hash.new { |h,id|
h[id] = Hash.new { |ids,name| ids[name] = [] }
}
@event_stack = []
super
end
......@@ -97,17 +95,17 @@ def start(name, id, payload)
return unless logger
e = ActiveSupport::Notifications::Event.new(name, Time.now, nil, id, payload)
parent = @event_stack[id][name].last
parent = @event_stack.last
parent << e if parent
@event_stack[id][name].push e
@event_stack.push e
end
def finish(name, id, payload)
return unless logger
finished = Time.now
event = @event_stack[id][name].pop
event = @event_stack.pop
event.end = finished
method = name.split('.').first
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册