harness 0.9.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/README.md +108 -323
- data/harness.gemspec +3 -12
- data/lib/harness.rb +69 -68
- data/lib/harness/async_queue.rb +29 -0
- data/lib/harness/fake_collector.rb +40 -0
- data/lib/harness/instrumentation.rb +21 -6
- data/lib/harness/null_collector.rb +23 -0
- data/lib/harness/subscription.rb +7 -0
- data/lib/harness/sync_queue.rb +14 -0
- data/lib/harness/version.rb +1 -1
- data/test/acceptance_test.rb +20 -0
- data/test/active_support_notifications_test.rb +93 -0
- data/test/async_queue_test.rb +14 -0
- data/test/instrumentation_test.rb +54 -0
- data/test/null_collector_test.rb +29 -0
- data/test/test_helper.rb +38 -34
- metadata +21 -196
- data/lib/harness/adapters/librato_adapter.rb +0 -90
- data/lib/harness/adapters/memory_adapter.rb +0 -27
- data/lib/harness/adapters/null_adapter.rb +0 -11
- data/lib/harness/adapters/stathat_adapter.rb +0 -75
- data/lib/harness/adapters/statsd_adapter.rb +0 -50
- data/lib/harness/consumer.rb +0 -35
- data/lib/harness/counter.rb +0 -29
- data/lib/harness/gauge.rb +0 -23
- data/lib/harness/integration/action_controller.rb +0 -9
- data/lib/harness/integration/action_mailer.rb +0 -9
- data/lib/harness/integration/action_view.rb +0 -9
- data/lib/harness/integration/active_model_serializers.rb +0 -9
- data/lib/harness/integration/active_support.rb +0 -9
- data/lib/harness/integration/sidekiq.rb +0 -47
- data/lib/harness/job.rb +0 -23
- data/lib/harness/measurement.rb +0 -43
- data/lib/harness/queues/delayed_job_queue.rb +0 -7
- data/lib/harness/queues/resque_queue.rb +0 -29
- data/lib/harness/queues/sidekiq_queue.rb +0 -31
- data/lib/harness/queues/synchronous_queue.rb +0 -18
- data/lib/harness/railtie.rb +0 -71
- data/lib/harness/tasks.rake +0 -6
- data/test/integration/counters_with_redis_test.rb +0 -67
- data/test/integration/instrumentation_test.rb +0 -50
- data/test/integration/integrations/action_controller_test.rb +0 -51
- data/test/integration/integrations/action_mailer_test.rb +0 -22
- data/test/integration/integrations/action_view_test.rb +0 -32
- data/test/integration/integrations/active_model_serializers_test.rb +0 -22
- data/test/integration/integrations/active_support_test.rb +0 -41
- data/test/integration/integrations/sidekiq_test.rb +0 -54
- data/test/integration/logging_test.rb +0 -17
- data/test/integration/queues/delayed_job_test.rb +0 -59
- data/test/integration/queues/resque_test.rb +0 -24
- data/test/integration/queues/sidekiq_test.rb +0 -34
- data/test/integration/railtie_test.rb +0 -26
- data/test/unit/adapters/librato_adapter_test.rb +0 -169
- data/test/unit/adapters/memory_adapter_test.rb +0 -22
- data/test/unit/adapters/stathat_adapter_test.rb +0 -144
- data/test/unit/adapters/statsd_adapter_test.rb +0 -74
- data/test/unit/counter_test.rb +0 -84
- data/test/unit/gauge_test.rb +0 -93
- data/test/unit/harness_test.rb +0 -39
- data/test/unit/measurement_test.rb +0 -76
@@ -1,76 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class MeasurementTest < MiniTest::Unit::TestCase
|
4
|
-
def setup
|
5
|
-
@measurement = Harness::Measurement.new
|
6
|
-
end
|
7
|
-
|
8
|
-
def test_has_an_id_attribute
|
9
|
-
assert @measurement.respond_to?(:id)
|
10
|
-
assert @measurement.respond_to?(:id=)
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_has_a_source_attribute
|
14
|
-
assert @measurement.respond_to?(:source)
|
15
|
-
assert @measurement.respond_to?(:source=)
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_has_a_time_attribute
|
19
|
-
assert @measurement.respond_to?(:time)
|
20
|
-
assert @measurement.respond_to?(:time=)
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_has_a_value_attribute
|
24
|
-
assert @measurement.respond_to?(:value)
|
25
|
-
assert @measurement.respond_to?(:value=)
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_has_a_name_attribute
|
29
|
-
assert @measurement.respond_to?(:name)
|
30
|
-
assert @measurement.respond_to?(:name=)
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_initializes_time
|
34
|
-
assert @measurement.time
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_can_take_a_string_time
|
38
|
-
@measurement.time = "2010-10-1T15:15:15Z"
|
39
|
-
|
40
|
-
assert_equal DateTime.parse("2010-10-1T15:15:15Z"), @measurement.time
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_can_take_an_integer_time
|
44
|
-
time = Time.now
|
45
|
-
|
46
|
-
@measurement.time = time.to_i
|
47
|
-
|
48
|
-
assert_equal time.to_i, @measurement.time.to_i
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_can_take_a_time
|
52
|
-
time = Time.now
|
53
|
-
|
54
|
-
@measurement.time = time
|
55
|
-
|
56
|
-
assert_equal time, @measurement.time
|
57
|
-
end
|
58
|
-
|
59
|
-
def test_source_defaults_to_config
|
60
|
-
Harness.config.source = 'foo'
|
61
|
-
|
62
|
-
@measurement = Harness::Measurement.new
|
63
|
-
assert_equal 'foo', @measurement.source
|
64
|
-
end
|
65
|
-
|
66
|
-
def test_attributes
|
67
|
-
hash = @measurement.attributes
|
68
|
-
|
69
|
-
assert hash.has_key?(:id)
|
70
|
-
assert hash.has_key?(:name)
|
71
|
-
assert hash.has_key?(:source)
|
72
|
-
assert hash.has_key?(:time)
|
73
|
-
assert hash.has_key?(:units)
|
74
|
-
assert hash.has_key?(:value)
|
75
|
-
end
|
76
|
-
end
|