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 +4 -4
- data/lib/harness/instrumentation.rb +4 -0
- data/lib/harness/version.rb +1 -1
- data/test/instrumentation_test.rb +6 -0
- data/test/test_helper.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9942b30f8e419f7478ae9df71bb853464116617e
|
4
|
+
data.tar.gz: a8ee4cb67f037fbf363804f24c3ddddaa3e2e5da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19cf58a3682780109598f2fc874a8ace7ac0eab989ade2d03b5fe085dde9fc0db8a8d0005d1b70b85a3e2b76495a3b28dfcefdcc7e651e95fa18db25f922df23
|
7
|
+
data.tar.gz: f4362488eeb5b0af4ad2772950efb5ec859ed7f8284175282760b14719185368b1992dbfcbfd017de481cc9983d4ba585de930a1a2179e261ba1b1f85e465e03
|
data/lib/harness/version.rb
CHANGED
@@ -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
|
data/test/test_helper.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2013-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|