harness-active_publisher 0.5.0 → 1.0.0

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: 305ec8bb2aeba0fb34e7b71a622de8ba12f77b50
4
- data.tar.gz: 4698fa4418a5f48735f3419c09f0afd9da1cd124
3
+ metadata.gz: 2c8406c4436e248e55c89fba264833993ab57b58
4
+ data.tar.gz: 820a74e56d4bf6788947babc1d9981657c103bc5
5
5
  SHA512:
6
- metadata.gz: 6027666c07475c3ddaccde78e7aca7414fa5a604c5323cfaef0bad37031c93208632081c61b19937225ad12cebe7a883c6df4abc61129249bd0b4cb34222dac6
7
- data.tar.gz: d2dea45b8463dc632fdb0d2513c1d2cc1099cb81aaf0fab50985b51abbacf55a670aae1aca7440148464c2cb8f78efbeea8d9ec1b5937e4767dc7a5069ddd381
6
+ metadata.gz: 2421be092365302abbb5a8115552b91301b2b0a8a8244d290ec1ccfbafe8c160755791a30fffdad057be0131f989225f1c9c2d1c19c8822c567175a65b1d09e7
7
+ data.tar.gz: ff6d94490814361e6c25698d4444d3e71c1b582e7de8cb173f7ef13571a3448f758e365f0bc7bc68437369c0ccce1dcb287d5c9b0bbe541e2cbab33dc04b1400
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_runtime_dependency "activesupport", ">= 3.2"
25
25
  spec.add_runtime_dependency "harness", ">= 2.0.0"
26
26
 
27
- spec.add_development_dependency "bundler", "~> 1.15"
27
+ spec.add_development_dependency "bundler"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
29
29
  spec.add_development_dependency "rspec", "~> 3.0"
30
30
  end
@@ -3,28 +3,32 @@ require "harness/active_publisher/version"
3
3
  require "harness"
4
4
  require "active_support"
5
5
 
6
- DROPPED_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "message_dropped"].reject(&:nil?).join(".").freeze
7
- LATENCY_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "publish_latency"].reject(&:nil?).join(".").freeze
8
- PUBLISHED_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "messages_published"].reject(&:nil?).join(".").freeze
9
- QUEUE_SIZE_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "async_queue_size"].reject(&:nil?).join(".").freeze
10
- WAIT_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "waiting_for_async_queue"].reject(&:nil?).join(".").freeze
6
+ module Harness
7
+ module ActivePublisher
8
+ DROPPED_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "message_dropped"].reject(&:nil?).join(".").freeze
9
+ LATENCY_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "publish_latency"].reject(&:nil?).join(".").freeze
10
+ PUBLISHED_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "messages_published"].reject(&:nil?).join(".").freeze
11
+ QUEUE_SIZE_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "async_queue_size"].reject(&:nil?).join(".").freeze
12
+ WAIT_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "waiting_for_async_queue"].reject(&:nil?).join(".").freeze
11
13
 
12
- ::ActiveSupport::Notifications.subscribe "async_queue_size.active_publisher" do |_, _, _, _, async_queue_size|
13
- ::Harness.gauge QUEUE_SIZE_METRIC, async_queue_size
14
- end
14
+ ::ActiveSupport::Notifications.subscribe "async_queue_size.active_publisher" do |_, _, _, _, async_queue_size|
15
+ ::Harness.gauge QUEUE_SIZE_METRIC, async_queue_size
16
+ end
15
17
 
16
- ::ActiveSupport::Notifications.subscribe "message_dropped.active_publisher" do
17
- ::Harness.increment DROPPED_METRIC
18
- end
18
+ ::ActiveSupport::Notifications.subscribe "message_dropped.active_publisher" do
19
+ ::Harness.increment DROPPED_METRIC
20
+ end
19
21
 
20
- ::ActiveSupport::Notifications.subscribe "message_published.active_publisher" do |*args|
21
- event = ::ActiveSupport::Notifications::Event.new(*args)
22
- message_count = event.payload.fetch(:message_count, 1)
23
- ::Harness.count PUBLISHED_METRIC, message_count
24
- ::Harness.timing LATENCY_METRIC, event.duration
25
- end
22
+ ::ActiveSupport::Notifications.subscribe "message_published.active_publisher" do |*args|
23
+ event = ::ActiveSupport::Notifications::Event.new(*args)
24
+ message_count = event.payload.fetch(:message_count, 1)
25
+ ::Harness.count PUBLISHED_METRIC, message_count
26
+ ::Harness.timing LATENCY_METRIC, event.duration
27
+ end
26
28
 
27
- ::ActiveSupport::Notifications.subscribe "wait_for_async_queue.active_publisher" do |*args|
28
- event = ::ActiveSupport::Notifications::Event.new(*args)
29
- ::Harness.timing WAIT_METRIC, event.duration
29
+ ::ActiveSupport::Notifications.subscribe "wait_for_async_queue.active_publisher" do |*args|
30
+ event = ::ActiveSupport::Notifications::Event.new(*args)
31
+ ::Harness.timing WAIT_METRIC, event.duration
32
+ end
33
+ end
30
34
  end
@@ -1,5 +1,5 @@
1
1
  module Harness
2
2
  module ActivePublisher
3
- VERSION = "0.5.0"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harness-active_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Ries
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-12 00:00:00.000000000 Z
11
+ date: 2019-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.15'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.15'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement