harness 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 231a1af8531021b021a97eec867519b6e2d75813
4
- data.tar.gz: 539d0e596ef148b085286b3fdf7e6b8a85b14725
3
+ metadata.gz: 9942b30f8e419f7478ae9df71bb853464116617e
4
+ data.tar.gz: a8ee4cb67f037fbf363804f24c3ddddaa3e2e5da
5
5
  SHA512:
6
- metadata.gz: 169cb10c469eb21a91d3f0fdb884595aadd66ea487da6a5408b530af6f2a68ae0dd26dbe61900514146b6474e187a001c26e2b7b422dddcc3a8dd5f4e2cbb610
7
- data.tar.gz: bceeb202d6c69d3688a5085ecf2b6e25f5a32182ed3dd041214fe619828021c8dd7c02d94be50e175c961484288274e2970f107997d84343d0880cb3592edc61
6
+ metadata.gz: 19cf58a3682780109598f2fc874a8ace7ac0eab989ade2d03b5fe085dde9fc0db8a8d0005d1b70b85a3e2b76495a3b28dfcefdcc7e651e95fa18db25f922df23
7
+ data.tar.gz: f4362488eeb5b0af4ad2772950efb5ec859ed7f8284175282760b14719185368b1992dbfcbfd017de481cc9983d4ba585de930a1a2179e261ba1b1f85e465e03
@@ -19,5 +19,9 @@ module Harness
19
19
  def decrement(*args)
20
20
  Harness.decrement *args
21
21
  end
22
+
23
+ def count(*args)
24
+ Harness.count *args
25
+ end
22
26
  end
23
27
  end
@@ -1,3 +1,3 @@
1
1
  module Harness
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -21,6 +21,11 @@ class InstrumentationTest < MiniTest::Unit::TestCase
21
21
  assert_decrement 'foo'
22
22
  end
23
23
 
24
+ def test_can_use_count
25
+ worker.count 'foo', 1, 0.5
26
+ assert_counter 'foo'
27
+ end
28
+
24
29
  def test_can_use_gauges
25
30
  worker.gauge 'foo', 5, 0.5
26
31
  assert_gauge 'foo'
@@ -47,6 +52,7 @@ class InstrumentationTest < MiniTest::Unit::TestCase
47
52
 
48
53
  assert_respond_to extended, :increment
49
54
  assert_respond_to extended, :decrement
55
+ assert_respond_to extended, :count
50
56
  assert_respond_to extended, :time
51
57
  assert_respond_to extended, :timing
52
58
  assert_respond_to extended, :gauge
@@ -40,6 +40,12 @@ class MiniTest::Unit::TestCase
40
40
  assert gauge, "gauge #{name} not logged!"
41
41
  end
42
42
 
43
+ def assert_counter(name)
44
+ refute_empty counters
45
+ counter = counters.find { |g| g.name == name }
46
+ assert counter, "counter #{name} not logged!"
47
+ end
48
+
43
49
  def instrument(name, data = {}, &block)
44
50
  ActiveSupport::Notifications.instrument name, data, &block
45
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harness
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ahawkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-10 00:00:00.000000000 Z
11
+ date: 2013-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport