sized_list 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -61,6 +61,7 @@ module ActiveSupport
61
61
  payload[:eviction] = @sized_list.evicted?
62
62
  payload[:total_evictions] = @sized_list.evictions
63
63
  payload[:eviction_frequency] = @sized_list.eviction_frequency
64
+ payload[:last_time_between_evictions] = @sized_list.last_time_between_evictions
64
65
  end
65
66
  end
66
67
 
data/lib/sized_list.rb CHANGED
@@ -9,7 +9,8 @@ class SizedList
9
9
  attr_reader :hits,
10
10
  :misses,
11
11
  :writes,
12
- :evictions
12
+ :evictions,
13
+ :last_time_between_evictions
13
14
 
14
15
  def initialize(max_size)
15
16
  @max_size = max_size
@@ -24,6 +25,7 @@ class SizedList
24
25
  @writes = 0
25
26
  @evictions = 0
26
27
  @total_eviction_time = 0.0
28
+ @last_time_between_evictions = 0.0
27
29
  @last_evicted_at = nil
28
30
  end
29
31
 
@@ -103,7 +105,8 @@ class SizedList
103
105
  if @enable_time_based_stats
104
106
  now = Time.now
105
107
  if @last_evicted_at
106
- @total_eviction_time += now - @last_evicted_at
108
+ @last_time_between_evictions = now - @last_evicted_at
109
+ @total_eviction_time += @last_time_between_evictions
107
110
  end
108
111
  @last_evicted_at = now
109
112
  end
data/sized_list.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sized_list}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Doug Youch"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Doug Youch