Class: Glimpse::Views::Mongo
- Inherits:
-
View
- Object
- View
- Glimpse::Views::Mongo
- Defined in:
- lib/glimpse/views/mongo.rb
Instance Method Summary collapse
Instance Method Details
#calls ⇒ Object
66 67 68 |
# File 'lib/glimpse/views/mongo.rb', line 66 def calls ::Mongo::Connection.command_count.value end |
#duration ⇒ Object
53 54 55 |
# File 'lib/glimpse/views/mongo.rb', line 53 def duration ::Mongo::Connection.command_time.value end |
#formatted_duration ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/glimpse/views/mongo.rb', line 57 def formatted_duration ms = duration * 1000 if ms >= 1000 "%.2fms" % ms else "%.0fms" % ms end end |
#results ⇒ Object
70 71 72 |
# File 'lib/glimpse/views/mongo.rb', line 70 def results { :duration => formatted_duration, :calls => calls } end |