harness-active_publisher 1.1.0 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/harness-active_publisher.gemspec +1 -1
- data/lib/harness/active_publisher/version.rb +1 -1
- data/lib/harness/active_publisher.rb +33 -5
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7279ea648248d479891fdfbd4cc1862ebb87d44d0f9dcb959b3eb3e1099af7e5
|
4
|
+
data.tar.gz: 51087f85e2822c2d1f21fac5c1923321da7dc432d6ee4b04dd3bbad7b6074022
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b093298585fd0f98734d824fe92a8450672f4fc6c7063f07b9147ee1de55d75385ebde8e11147a83c64d7cc44e014e7bff796f9c88825081e12bad0cf59bb1f9
|
7
|
+
data.tar.gz: c56488db3d451da8d715ec40cd23fe46946ab2861deddd580f1caac79b2601ed6d9201745955e2843651c3c08e38c851f68ce281fd4b521bc0abdbf99103462c
|
@@ -25,6 +25,6 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_runtime_dependency "harness", ">= 2.0.0"
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler"
|
28
|
-
spec.add_development_dependency "rake", "
|
28
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
29
29
|
spec.add_development_dependency "rspec", "~> 3.0"
|
30
30
|
end
|
@@ -5,16 +5,38 @@ require "active_support"
|
|
5
5
|
|
6
6
|
module Harness
|
7
7
|
module ActivePublisher
|
8
|
-
DROPPED_METRIC
|
9
|
-
LATENCY_METRIC
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
+
PUBLISH_CONFIRM_LATENCY_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "publishes_confirmed_latency"].reject(&:nil?).join(".").freeze
|
11
|
+
PUBLISH_CONFIRMED_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "publishes_confirmed"].reject(&:nil?).join(".").freeze
|
12
|
+
PUBLISHED_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "messages_published"].reject(&:nil?).join(".").freeze
|
13
|
+
QUEUE_SIZE_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "async_queue_size"].reject(&:nil?).join(".").freeze
|
14
|
+
REDIS_QUEUE_SIZE_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "redis_async_queue_size"].reject(&:nil?).join(".").freeze
|
15
|
+
WAIT_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "waiting_for_async_queue"].reject(&:nil?).join(".").freeze
|
16
|
+
UNBLOCKED_METRIC = ["active_publisher", ENV["SERVICE_NAME"], "connection", "unblocked"].reject(&:nil?).join(".").freeze
|
17
|
+
|
18
|
+
REASON_IS_MISSING = "reason_for_blocking_is_missing"
|
13
19
|
|
14
20
|
::ActiveSupport::Notifications.subscribe "async_queue_size.active_publisher" do |_, _, _, _, async_queue_size|
|
15
21
|
::Harness.gauge QUEUE_SIZE_METRIC, async_queue_size
|
16
22
|
end
|
17
23
|
|
24
|
+
::ActiveSupport::Notifications.subscribe "connection_blocked.active_publisher" do |_, _, _, _, params|
|
25
|
+
reason = params.fetch(:reason) || REASON_IS_MISSING
|
26
|
+
blocked_metric = ["active_publisher", ENV["SERVICE_NAME"], "connection", "blocked", reason.gsub(/\W/, "_")].
|
27
|
+
reject(&:nil?).join(".")
|
28
|
+
|
29
|
+
::Harness.increment blocked_metric
|
30
|
+
end
|
31
|
+
|
32
|
+
::ActiveSupport::Notifications.subscribe "connection_unblocked.active_publisher" do
|
33
|
+
::Harness.increment UNBLOCKED_METRIC
|
34
|
+
end
|
35
|
+
|
36
|
+
::ActiveSupport::Notifications.subscribe "redis_async_queue_size.active_publisher" do |_, _, _, _, redis_async_queue_size|
|
37
|
+
::Harness.gauge REDIS_QUEUE_SIZE_METRIC, redis_async_queue_size
|
38
|
+
end
|
39
|
+
|
18
40
|
::ActiveSupport::Notifications.subscribe "message_dropped.active_publisher" do
|
19
41
|
::Harness.increment DROPPED_METRIC
|
20
42
|
end
|
@@ -28,6 +50,12 @@ module Harness
|
|
28
50
|
::Harness.timing LATENCY_METRIC, event.duration
|
29
51
|
end
|
30
52
|
|
53
|
+
::ActiveSupport::Notifications.subscribe "publishes_confirmed.active_publisher" do |*args|
|
54
|
+
event = ::ActiveSupport::Notifications::Event.new(*args)
|
55
|
+
::Harness.increment PUBLISH_CONFIRMED_METRIC
|
56
|
+
::Harness.timing PUBLISH_CONFIRM_LATENCY_METRIC, event.duration
|
57
|
+
end
|
58
|
+
|
31
59
|
::ActiveSupport::Notifications.subscribe "wait_for_async_queue.active_publisher" do |*args|
|
32
60
|
event = ::ActiveSupport::Notifications::Event.new(*args)
|
33
61
|
::Harness.timing WAIT_METRIC, event.duration
|
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: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Ries
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 12.3.3
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 12.3.3
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,7 +105,7 @@ homepage: https://github.com/mxenabled/harness-active_publisher
|
|
105
105
|
licenses:
|
106
106
|
- MIT
|
107
107
|
metadata: {}
|
108
|
-
post_install_message:
|
108
|
+
post_install_message:
|
109
109
|
rdoc_options: []
|
110
110
|
require_paths:
|
111
111
|
- lib
|
@@ -120,9 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
|
124
|
-
|
125
|
-
signing_key:
|
123
|
+
rubygems_version: 3.0.1
|
124
|
+
signing_key:
|
126
125
|
specification_version: 4
|
127
126
|
summary: a gem to collect instrumation stats from active_publisher and forward them
|
128
127
|
to harness
|