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 +4 -4
- data/lib/harness/active_publisher.rb +11 -5
- data/lib/harness/active_publisher/version.rb +1 -1
- 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: 23f5656aef12ffca58378a6f1c6ac38ebc2e5bf2
|
4
|
+
data.tar.gz: 8ba58a4d640809221f2636dbf84ae719dcab36e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
18
|
-
::Harness.timing
|
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
|
29
|
+
::Harness.timing WAIT_METRIC, event.duration
|
24
30
|
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.
|
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-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|