lib/rorvswild/plugin/mongo.rb in rorvswild-0.6.1 vs lib/rorvswild/plugin/mongo.rb in rorvswild-1.0.0.pre.alpha
- old
+ new
@@ -13,10 +13,11 @@
def initialize
@commands = {}
end
def started(event)
+ RorVsWild::Section.start
commands[event.request_id] = event.command
end
def failed(event)
after_query(event)
@@ -25,13 +26,13 @@
def succeeded(event)
after_query(event)
end
def after_query(event)
- runtime = event.duration * 1000
- command = commands.delete(event.request_id).to_s
- file, line, method = RorVsWild.client.extract_most_relevant_location(caller)
- RorVsWild.client.send(:push_query, kind: "mongo", command: command, file: file, line: line, method: method, runtime: runtime)
+ RorVsWild::Section.stop do |section|
+ section.kind = "mongo".freeze
+ section.command = commands.delete(event.request_id).to_s
+ end
end
end
end
end