Class: RorVsWild::Plugin::Mongo
- Inherits:
-
Object
- Object
- RorVsWild::Plugin::Mongo
- Defined in:
- lib/rorvswild/plugin/mongo.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
Class Method Summary collapse
Instance Method Summary collapse
- #after_query(event) ⇒ Object
- #failed(event) ⇒ Object
-
#initialize ⇒ Mongo
constructor
A new instance of Mongo.
- #started(event) ⇒ Object
- #succeeded(event) ⇒ Object
Constructor Details
#initialize ⇒ Mongo
Returns a new instance of Mongo.
13 14 15 |
# File 'lib/rorvswild/plugin/mongo.rb', line 13 def initialize @commands = {} end |
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands
11 12 13 |
# File 'lib/rorvswild/plugin/mongo.rb', line 11 def commands @commands end |
Class Method Details
Instance Method Details
#after_query(event) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/rorvswild/plugin/mongo.rb', line 30 def after_query(event) RorVsWild::Section.stop do |section| section.kind = "mongo".freeze section.command = commands.delete(event.request_id).to_s end end |
#failed(event) ⇒ Object
22 23 24 |
# File 'lib/rorvswild/plugin/mongo.rb', line 22 def failed(event) after_query(event) end |
#started(event) ⇒ Object
17 18 19 20 |
# File 'lib/rorvswild/plugin/mongo.rb', line 17 def started(event) RorVsWild::Section.start commands[event.request_id] = event.command end |
#succeeded(event) ⇒ Object
26 27 28 |
# File 'lib/rorvswild/plugin/mongo.rb', line 26 def succeeded(event) after_query(event) end |