Class: Glimpse::Views::Redis
- Inherits:
-
View
- Object
- View
- Glimpse::Views::Redis
- Defined in:
- lib/glimpse/views/redis.rb
Instance Method Summary collapse
Instance Method Details
#calls ⇒ Object
39 40 41 |
# File 'lib/glimpse/views/redis.rb', line 39 def calls ::Redis::Client.query_count.value end |
#duration ⇒ Object
26 27 28 |
# File 'lib/glimpse/views/redis.rb', line 26 def duration ::Redis::Client.query_time.value end |
#formatted_duration ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/glimpse/views/redis.rb', line 30 def formatted_duration ms = duration * 1000 if ms >= 1000 "%.2fms" % ms else "%.0fms" % ms end end |
#results ⇒ Object
43 44 45 |
# File 'lib/glimpse/views/redis.rb', line 43 def results { :duration => formatted_duration, :calls => calls } end |