Class: Glimpse::Views::Redis

Inherits:
View
  • Object
show all
Defined in:
lib/glimpse/views/redis.rb

Instance Method Summary collapse

Instance Method Details

#callsObject



39
40
41
# File 'lib/glimpse/views/redis.rb', line 39

def calls
  ::Redis::Client.query_count.value
end

#durationObject



26
27
28
# File 'lib/glimpse/views/redis.rb', line 26

def duration
  ::Redis::Client.query_time.value
end

#formatted_durationObject



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

#resultsObject



43
44
45
# File 'lib/glimpse/views/redis.rb', line 43

def results
  { :duration => formatted_duration, :calls => calls }
end