Class: Mongo::Connection
- Inherits:
-
Object
- Object
- Mongo::Connection
- Defined in:
- lib/glimpse/views/mongo.rb
Overview
Instrument Mongo time
Class Attribute Summary collapse
-
.command_count ⇒ Object
Returns the value of attribute command_count.
-
.command_time ⇒ Object
Returns the value of attribute command_time.
Instance Method Summary collapse
- #receive_message_with_timing(*args) ⇒ Object
- #send_message_with_gle_with_timing(*args) ⇒ Object
- #send_message_with_timing(*args) ⇒ Object
Class Attribute Details
.command_count ⇒ Object
Returns the value of attribute command_count.
14 15 16 |
# File 'lib/glimpse/views/mongo.rb', line 14 def command_count @command_count end |
.command_time ⇒ Object
Returns the value of attribute command_time.
14 15 16 |
# File 'lib/glimpse/views/mongo.rb', line 14 def command_time @command_time end |
Instance Method Details
#receive_message_with_timing(*args) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/glimpse/views/mongo.rb', line 39 def (*args) start = Time.now (*args) ensure duration = (Time.now - start) Mongo::Connection.command_time.update { |value| value + duration } Mongo::Connection.command_count.update { |value| value + 1 } end |
#send_message_with_gle_with_timing(*args) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/glimpse/views/mongo.rb', line 29 def (*args) start = Time.now (*args) ensure duration = (Time.now - start) Mongo::Connection.command_time.update { |value| value + duration } Mongo::Connection.command_count.update { |value| value + 1 } end |
#send_message_with_timing(*args) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/glimpse/views/mongo.rb', line 19 def (*args) start = Time.now (*args) ensure duration = (Time.now - start) Mongo::Connection.command_time.update { |value| value + duration } Mongo::Connection.command_count.update { |value| value + 1 } end |