Class: Insight::CachePanel::Stats::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/insight/panels/cache_panel/stats.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Query) initialize(method, time, hit, keys)

A new instance of Query



8
9
10
11
12
13
# File 'lib/insight/panels/cache_panel/stats.rb', line 8

def initialize(method, time, hit, keys)
  @method = method
  @time = time
  @hit = hit
  @keys = keys
end

Instance Attribute Details

- (Object) hit (readonly)

Returns the value of attribute hit



6
7
8
# File 'lib/insight/panels/cache_panel/stats.rb', line 6

def hit
  @hit
end

- (Object) keys (readonly)

Returns the value of attribute keys



6
7
8
# File 'lib/insight/panels/cache_panel/stats.rb', line 6

def keys
  @keys
end

- (Object) method (readonly)

Returns the value of attribute method



6
7
8
# File 'lib/insight/panels/cache_panel/stats.rb', line 6

def method
  @method
end

- (Object) time (readonly)

Returns the value of attribute time



6
7
8
# File 'lib/insight/panels/cache_panel/stats.rb', line 6

def time
  @time
end

Instance Method Details

- (Object) display_keys



19
20
21
22
23
24
25
# File 'lib/insight/panels/cache_panel/stats.rb', line 19

def display_keys
  if keys.size == 1
    keys.first
  else
    keys.join(", ")
  end
end

- (Object) display_time



15
16
17
# File 'lib/insight/panels/cache_panel/stats.rb', line 15

def display_time
  "%.2fms" % time
end