metriks 0.9.9 → 0.9.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -348,13 +348,16 @@ An incomplete list of things I would like to see added:
348
348
 
349
349
  # Credits
350
350
 
351
- Most of the inspiration for this project comes from the amazing talk that
352
- Code Hale gave at CodeConf and his sweet
353
- [Metrics](https://github.com/codahale/metrics) Java library.
351
+ Most of the inspiration for this project comes from Coda Hale's amazing
352
+ [Metrics, Metrics Everywhere][metrics-talk] talk at CodeConf and his sweet
353
+ [Metrics][metrics] Java Library.
354
+
355
+ [metrics-talk]: http://pivotallabs.com/talks/139-metrics-metrics-everywhere
356
+ [metrics]: https://github.com/codahale/metrics
354
357
 
355
358
 
356
359
  # License
357
360
 
358
361
  Copyright (c) 2012 Eric Lindvall
359
362
 
360
- Published under the MIT License, see LICENSE
363
+ Published under the MIT License, see LICENSE
data/lib/metriks.rb CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Metriks
3
- VERSION = '0.9.9'
3
+ VERSION = '0.9.9.1'
4
4
 
5
5
  def self.get(name)
6
6
  Metriks::Registry.default.get(name)
@@ -39,6 +39,7 @@ module Metriks
39
39
  def update(value, timestamp = Time.now)
40
40
  @mutex.synchronize do
41
41
  priority = weight(timestamp - @start_time) / rand
42
+ priority = Float::MAX if priority.infinite?
42
43
  new_count = @count.update { |v| v + 1 }
43
44
 
44
45
  if priority.nan?
data/metriks.gemspec CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'metriks'
16
- s.version = '0.9.9'
17
- s.date = '2012-06-29'
16
+ s.version = '0.9.9.1'
17
+ s.date = '2012-07-02'
18
18
 
19
19
  ## Make sure your summary is short. The description may be as long
20
20
  ## as you like.
@@ -185,4 +185,15 @@ class HistogramTest < Test::Unit::TestCase
185
185
 
186
186
  assert_equal 49.5, snapshot.median
187
187
  end
188
+
189
+ def test_long_idle_sample
190
+ Time.stubs(:now).returns(Time.at(2000))
191
+ sample = Metriks::ExponentiallyDecayingSample.new(Metriks::Histogram::DEFAULT_SAMPLE_SIZE, Metriks::Histogram::DEFAULT_ALPHA)
192
+ Time.unstub(:now)
193
+ @histogram = Metriks::Histogram.new(sample)
194
+
195
+ @histogram.update(5)
196
+
197
+ assert_equal 5, @histogram.min
198
+ end
188
199
  end
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 9
8
8
  - 9
9
- version: 0.9.9
9
+ - 1
10
+ version: 0.9.9.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Eric Lindvall
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2012-06-29 00:00:00 -07:00
18
+ date: 2012-07-02 00:00:00 -07:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency