harness-active_publisher 0.3.0 → 0.4.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: 5acbdd5a46daa765d1ec73217830185e8b7a9659
4
- data.tar.gz: 7bc628ebe90545f33d48a74b565205c7ac04188b
3
+ metadata.gz: 23f5656aef12ffca58378a6f1c6ac38ebc2e5bf2
4
+ data.tar.gz: 8ba58a4d640809221f2636dbf84ae719dcab36e0
5
5
  SHA512:
6
- metadata.gz: 8745ebe6f1ded594fae13032f419daf40c9551dc271b1cfb154f0a1955486f8c9a2693a4d1d97af75c3cbad835ce8b2843b45f98d151defdcddfcaa5416fc40e
7
- data.tar.gz: 55a7fb68cb41bb6528796fdb7c28b5f25b98b4c689153d659f08da66ba4ae39c1cecc9d10f7f80f808992aaf1251819cc00b33b77b33ec6cbfcbf95213930ddd
6
+ metadata.gz: 314e3cb9c5230949a481cb596a8c9f5f05006db6e29ee8e4fb6e74f154f91f6e399e504ae9601ec8649ae9cd7c34aa34cc27ac0cb26bbed4b6edb2259fec13ce
7
+ data.tar.gz: 8589ffa0def40858886f7ff5e38e88d985e8248a60f629bfb367b31f8a645327e9f033a547ed341960a1cfafc0d1f5b9aa2ce0cc3036b9e2cb34380c9343a9ba
@@ -3,22 +3,28 @@ 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
11
+
6
12
  ::ActiveSupport::Notifications.subscribe "async_queue_size.active_publisher" do |_, _, _, _, async_queue_size|
7
- ::Harness.gauge "active_publisher.async_queue_size", async_queue_size
13
+ ::Harness.gauge QUEUE_SIZE_METRIC, async_queue_size
8
14
  end
9
15
 
10
16
  ::ActiveSupport::Notifications.subscribe "message_dropped.active_publisher" do
11
- ::Harness.increment "active_publisher.message_dropped"
17
+ ::Harness.increment DROPPED_METRIC
12
18
  end
13
19
 
14
20
  ::ActiveSupport::Notifications.subscribe "message_published.active_publisher" do |*args|
15
21
  event = ::ActiveSupport::Notifications::Event.new(*args)
16
22
  message_count = event.payload.fetch(:message_count, 1)
17
- ::Harness.increment "active_publisher.messages_published", message_count
18
- ::Harness.timing "active_publisher.publish_latency", event.duration
23
+ ::Harness.increment PUBLISHED_METRIC, message_count
24
+ ::Harness.timing LATENCY_METRIC, event.duration
19
25
  end
20
26
 
21
27
  ::ActiveSupport::Notifications.subscribe "wait_for_async_queue.active_publisher" do |*args|
22
28
  event = ::ActiveSupport::Notifications::Event.new(*args)
23
- ::Harness.timing "active_publisher.waiting_for_async_queue", event.duration
29
+ ::Harness.timing WAIT_METRIC, event.duration
24
30
  end
@@ -1,5 +1,5 @@
1
1
  module Harness
2
2
  module ActivePublisher
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.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.3.0
4
+ version: 0.4.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: 2017-09-05 00:00:00.000000000 Z
11
+ date: 2017-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport