harness 0.9.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/README.md +108 -323
  4. data/harness.gemspec +3 -12
  5. data/lib/harness.rb +69 -68
  6. data/lib/harness/async_queue.rb +29 -0
  7. data/lib/harness/fake_collector.rb +40 -0
  8. data/lib/harness/instrumentation.rb +21 -6
  9. data/lib/harness/null_collector.rb +23 -0
  10. data/lib/harness/subscription.rb +7 -0
  11. data/lib/harness/sync_queue.rb +14 -0
  12. data/lib/harness/version.rb +1 -1
  13. data/test/acceptance_test.rb +20 -0
  14. data/test/active_support_notifications_test.rb +93 -0
  15. data/test/async_queue_test.rb +14 -0
  16. data/test/instrumentation_test.rb +54 -0
  17. data/test/null_collector_test.rb +29 -0
  18. data/test/test_helper.rb +38 -34
  19. metadata +21 -196
  20. data/lib/harness/adapters/librato_adapter.rb +0 -90
  21. data/lib/harness/adapters/memory_adapter.rb +0 -27
  22. data/lib/harness/adapters/null_adapter.rb +0 -11
  23. data/lib/harness/adapters/stathat_adapter.rb +0 -75
  24. data/lib/harness/adapters/statsd_adapter.rb +0 -50
  25. data/lib/harness/consumer.rb +0 -35
  26. data/lib/harness/counter.rb +0 -29
  27. data/lib/harness/gauge.rb +0 -23
  28. data/lib/harness/integration/action_controller.rb +0 -9
  29. data/lib/harness/integration/action_mailer.rb +0 -9
  30. data/lib/harness/integration/action_view.rb +0 -9
  31. data/lib/harness/integration/active_model_serializers.rb +0 -9
  32. data/lib/harness/integration/active_support.rb +0 -9
  33. data/lib/harness/integration/sidekiq.rb +0 -47
  34. data/lib/harness/job.rb +0 -23
  35. data/lib/harness/measurement.rb +0 -43
  36. data/lib/harness/queues/delayed_job_queue.rb +0 -7
  37. data/lib/harness/queues/resque_queue.rb +0 -29
  38. data/lib/harness/queues/sidekiq_queue.rb +0 -31
  39. data/lib/harness/queues/synchronous_queue.rb +0 -18
  40. data/lib/harness/railtie.rb +0 -71
  41. data/lib/harness/tasks.rake +0 -6
  42. data/test/integration/counters_with_redis_test.rb +0 -67
  43. data/test/integration/instrumentation_test.rb +0 -50
  44. data/test/integration/integrations/action_controller_test.rb +0 -51
  45. data/test/integration/integrations/action_mailer_test.rb +0 -22
  46. data/test/integration/integrations/action_view_test.rb +0 -32
  47. data/test/integration/integrations/active_model_serializers_test.rb +0 -22
  48. data/test/integration/integrations/active_support_test.rb +0 -41
  49. data/test/integration/integrations/sidekiq_test.rb +0 -54
  50. data/test/integration/logging_test.rb +0 -17
  51. data/test/integration/queues/delayed_job_test.rb +0 -59
  52. data/test/integration/queues/resque_test.rb +0 -24
  53. data/test/integration/queues/sidekiq_test.rb +0 -34
  54. data/test/integration/railtie_test.rb +0 -26
  55. data/test/unit/adapters/librato_adapter_test.rb +0 -169
  56. data/test/unit/adapters/memory_adapter_test.rb +0 -22
  57. data/test/unit/adapters/stathat_adapter_test.rb +0 -144
  58. data/test/unit/adapters/statsd_adapter_test.rb +0 -74
  59. data/test/unit/counter_test.rb +0 -84
  60. data/test/unit/gauge_test.rb +0 -93
  61. data/test/unit/harness_test.rb +0 -39
  62. 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