yabeda-rabbit_messaging 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.github/workflows/test.yml +36 -0
- data/.gitignore +13 -0
- data/.rubocop.yml +6 -0
- data/CHANGELOG.md +2 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +298 -0
- data/LICENSE.md +21 -0
- data/README.md +47 -0
- data/Rakefile +12 -0
- data/bin/console +8 -0
- data/bin/setup +8 -0
- data/lib/yabeda/rabbit_messaging/job_patch.rb +22 -0
- data/lib/yabeda/rabbit_messaging/version.rb +7 -0
- data/lib/yabeda/rabbit_messaging.rb +29 -0
- metadata +88 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: ab3e738f91cd528e2f9a395f55e4b4cd9188cc60ec54d9e4e8e442fb44fe1785
|
|
4
|
+
data.tar.gz: 7506c6e0a2bf7aa562a6a93b2c2f65781b243b9bc713432d973c03268c9d6211
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b25dbecd7a6432ca9682102524354fd7778bbb90667e17efb6d888871bfa98c1394d6d5e5d507e950b87bfc3d9330aafee422d6951c51c6884155154cbcfffba
|
|
7
|
+
data.tar.gz: e2210077626d15d072a2f7998beb2ccf53044cb850c45f82dce1ae363e6ecc8fe60b3257d81b28136843b8545dcff1eeeb277fe80602d1daf29e79e4dcd5c836
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
|
|
8
|
+
pull_request:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
rubocop:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v2
|
|
15
|
+
- uses: ruby/setup-ruby@v1
|
|
16
|
+
with:
|
|
17
|
+
ruby-version: 3
|
|
18
|
+
bundler-cache: true
|
|
19
|
+
- name: Run rubocop
|
|
20
|
+
run: bundle exec rubocop
|
|
21
|
+
|
|
22
|
+
rspec:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
|
|
25
|
+
strategy:
|
|
26
|
+
matrix:
|
|
27
|
+
ruby: [2.7, 3.0, 3.1, 3.2]
|
|
28
|
+
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v2
|
|
31
|
+
- uses: ruby/setup-ruby@v1
|
|
32
|
+
with:
|
|
33
|
+
ruby-version: ${{ matrix.ruby }}
|
|
34
|
+
bundler-cache: true
|
|
35
|
+
- name: Run rspec
|
|
36
|
+
run: bundle exec rspec
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
yabeda-rabbit_messaging (0.0.1)
|
|
5
|
+
rabbit_messaging (~> 0.6)
|
|
6
|
+
yabeda (~> 0.8)
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
actioncable (7.1.2)
|
|
12
|
+
actionpack (= 7.1.2)
|
|
13
|
+
activesupport (= 7.1.2)
|
|
14
|
+
nio4r (~> 2.0)
|
|
15
|
+
websocket-driver (>= 0.6.1)
|
|
16
|
+
zeitwerk (~> 2.6)
|
|
17
|
+
actionmailbox (7.1.2)
|
|
18
|
+
actionpack (= 7.1.2)
|
|
19
|
+
activejob (= 7.1.2)
|
|
20
|
+
activerecord (= 7.1.2)
|
|
21
|
+
activestorage (= 7.1.2)
|
|
22
|
+
activesupport (= 7.1.2)
|
|
23
|
+
mail (>= 2.7.1)
|
|
24
|
+
net-imap
|
|
25
|
+
net-pop
|
|
26
|
+
net-smtp
|
|
27
|
+
actionmailer (7.1.2)
|
|
28
|
+
actionpack (= 7.1.2)
|
|
29
|
+
actionview (= 7.1.2)
|
|
30
|
+
activejob (= 7.1.2)
|
|
31
|
+
activesupport (= 7.1.2)
|
|
32
|
+
mail (~> 2.5, >= 2.5.4)
|
|
33
|
+
net-imap
|
|
34
|
+
net-pop
|
|
35
|
+
net-smtp
|
|
36
|
+
rails-dom-testing (~> 2.2)
|
|
37
|
+
actionpack (7.1.2)
|
|
38
|
+
actionview (= 7.1.2)
|
|
39
|
+
activesupport (= 7.1.2)
|
|
40
|
+
nokogiri (>= 1.8.5)
|
|
41
|
+
racc
|
|
42
|
+
rack (>= 2.2.4)
|
|
43
|
+
rack-session (>= 1.0.1)
|
|
44
|
+
rack-test (>= 0.6.3)
|
|
45
|
+
rails-dom-testing (~> 2.2)
|
|
46
|
+
rails-html-sanitizer (~> 1.6)
|
|
47
|
+
actiontext (7.1.2)
|
|
48
|
+
actionpack (= 7.1.2)
|
|
49
|
+
activerecord (= 7.1.2)
|
|
50
|
+
activestorage (= 7.1.2)
|
|
51
|
+
activesupport (= 7.1.2)
|
|
52
|
+
globalid (>= 0.6.0)
|
|
53
|
+
nokogiri (>= 1.8.5)
|
|
54
|
+
actionview (7.1.2)
|
|
55
|
+
activesupport (= 7.1.2)
|
|
56
|
+
builder (~> 3.1)
|
|
57
|
+
erubi (~> 1.11)
|
|
58
|
+
rails-dom-testing (~> 2.2)
|
|
59
|
+
rails-html-sanitizer (~> 1.6)
|
|
60
|
+
activejob (7.1.2)
|
|
61
|
+
activesupport (= 7.1.2)
|
|
62
|
+
globalid (>= 0.3.6)
|
|
63
|
+
activemodel (7.1.2)
|
|
64
|
+
activesupport (= 7.1.2)
|
|
65
|
+
activerecord (7.1.2)
|
|
66
|
+
activemodel (= 7.1.2)
|
|
67
|
+
activesupport (= 7.1.2)
|
|
68
|
+
timeout (>= 0.4.0)
|
|
69
|
+
activestorage (7.1.2)
|
|
70
|
+
actionpack (= 7.1.2)
|
|
71
|
+
activejob (= 7.1.2)
|
|
72
|
+
activerecord (= 7.1.2)
|
|
73
|
+
activesupport (= 7.1.2)
|
|
74
|
+
marcel (~> 1.0)
|
|
75
|
+
activesupport (7.1.2)
|
|
76
|
+
base64
|
|
77
|
+
bigdecimal
|
|
78
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
79
|
+
connection_pool (>= 2.2.5)
|
|
80
|
+
drb
|
|
81
|
+
i18n (>= 1.6, < 2)
|
|
82
|
+
minitest (>= 5.1)
|
|
83
|
+
mutex_m
|
|
84
|
+
tzinfo (~> 2.0)
|
|
85
|
+
amq-protocol (2.3.2)
|
|
86
|
+
anyway_config (2.6.0)
|
|
87
|
+
ruby-next-core (>= 0.15)
|
|
88
|
+
ast (2.4.2)
|
|
89
|
+
base64 (0.2.0)
|
|
90
|
+
bigdecimal (3.1.5)
|
|
91
|
+
builder (3.2.4)
|
|
92
|
+
bunny (2.22.0)
|
|
93
|
+
amq-protocol (~> 2.3, >= 2.3.1)
|
|
94
|
+
sorted_set (~> 1, >= 1.0.2)
|
|
95
|
+
coderay (1.1.3)
|
|
96
|
+
concurrent-ruby (1.2.2)
|
|
97
|
+
connection_pool (2.4.1)
|
|
98
|
+
crass (1.0.6)
|
|
99
|
+
date (3.3.4)
|
|
100
|
+
diff-lcs (1.5.0)
|
|
101
|
+
drb (2.2.0)
|
|
102
|
+
ruby2_keywords
|
|
103
|
+
dry-initializer (3.1.1)
|
|
104
|
+
erubi (1.12.0)
|
|
105
|
+
globalid (1.2.1)
|
|
106
|
+
activesupport (>= 6.1)
|
|
107
|
+
i18n (1.14.1)
|
|
108
|
+
concurrent-ruby (~> 1.0)
|
|
109
|
+
io-console (0.7.1)
|
|
110
|
+
irb (1.10.1)
|
|
111
|
+
rdoc
|
|
112
|
+
reline (>= 0.3.8)
|
|
113
|
+
json (2.7.1)
|
|
114
|
+
lamian (1.7.0)
|
|
115
|
+
rails (>= 4.2)
|
|
116
|
+
loofah (2.22.0)
|
|
117
|
+
crass (~> 1.0.2)
|
|
118
|
+
nokogiri (>= 1.12.0)
|
|
119
|
+
mail (2.8.1)
|
|
120
|
+
mini_mime (>= 0.1.1)
|
|
121
|
+
net-imap
|
|
122
|
+
net-pop
|
|
123
|
+
net-smtp
|
|
124
|
+
marcel (1.0.2)
|
|
125
|
+
method_source (1.0.0)
|
|
126
|
+
mini_mime (1.1.5)
|
|
127
|
+
minitest (5.20.0)
|
|
128
|
+
mutex_m (0.2.0)
|
|
129
|
+
net-imap (0.4.8)
|
|
130
|
+
date
|
|
131
|
+
net-protocol
|
|
132
|
+
net-pop (0.1.2)
|
|
133
|
+
net-protocol
|
|
134
|
+
net-protocol (0.2.2)
|
|
135
|
+
timeout
|
|
136
|
+
net-smtp (0.4.0)
|
|
137
|
+
net-protocol
|
|
138
|
+
nio4r (2.7.0)
|
|
139
|
+
nokogiri (1.15.5-arm64-darwin)
|
|
140
|
+
racc (~> 1.4)
|
|
141
|
+
nokogiri (1.15.5-x86_64-linux)
|
|
142
|
+
racc (~> 1.4)
|
|
143
|
+
parallel (1.24.0)
|
|
144
|
+
parser (3.2.2.4)
|
|
145
|
+
ast (~> 2.4.1)
|
|
146
|
+
racc
|
|
147
|
+
pry (0.14.2)
|
|
148
|
+
coderay (~> 1.1)
|
|
149
|
+
method_source (~> 1.0)
|
|
150
|
+
psych (5.1.2)
|
|
151
|
+
stringio
|
|
152
|
+
rabbit_messaging (0.13.0)
|
|
153
|
+
bunny (~> 2.0)
|
|
154
|
+
lamian
|
|
155
|
+
rails (>= 5.2)
|
|
156
|
+
sneakers (~> 2.0)
|
|
157
|
+
tainbox
|
|
158
|
+
racc (1.7.3)
|
|
159
|
+
rack (3.0.8)
|
|
160
|
+
rack-session (2.0.0)
|
|
161
|
+
rack (>= 3.0.0)
|
|
162
|
+
rack-test (2.1.0)
|
|
163
|
+
rack (>= 1.3)
|
|
164
|
+
rackup (2.1.0)
|
|
165
|
+
rack (>= 3)
|
|
166
|
+
webrick (~> 1.8)
|
|
167
|
+
rails (7.1.2)
|
|
168
|
+
actioncable (= 7.1.2)
|
|
169
|
+
actionmailbox (= 7.1.2)
|
|
170
|
+
actionmailer (= 7.1.2)
|
|
171
|
+
actionpack (= 7.1.2)
|
|
172
|
+
actiontext (= 7.1.2)
|
|
173
|
+
actionview (= 7.1.2)
|
|
174
|
+
activejob (= 7.1.2)
|
|
175
|
+
activemodel (= 7.1.2)
|
|
176
|
+
activerecord (= 7.1.2)
|
|
177
|
+
activestorage (= 7.1.2)
|
|
178
|
+
activesupport (= 7.1.2)
|
|
179
|
+
bundler (>= 1.15.0)
|
|
180
|
+
railties (= 7.1.2)
|
|
181
|
+
rails-dom-testing (2.2.0)
|
|
182
|
+
activesupport (>= 5.0.0)
|
|
183
|
+
minitest
|
|
184
|
+
nokogiri (>= 1.6)
|
|
185
|
+
rails-html-sanitizer (1.6.0)
|
|
186
|
+
loofah (~> 2.21)
|
|
187
|
+
nokogiri (~> 1.14)
|
|
188
|
+
railties (7.1.2)
|
|
189
|
+
actionpack (= 7.1.2)
|
|
190
|
+
activesupport (= 7.1.2)
|
|
191
|
+
irb
|
|
192
|
+
rackup (>= 1.0.0)
|
|
193
|
+
rake (>= 12.2)
|
|
194
|
+
thor (~> 1.0, >= 1.2.2)
|
|
195
|
+
zeitwerk (~> 2.6)
|
|
196
|
+
rainbow (3.1.1)
|
|
197
|
+
rake (12.3.3)
|
|
198
|
+
rbtree (0.4.6)
|
|
199
|
+
rdoc (6.6.2)
|
|
200
|
+
psych (>= 4.0.0)
|
|
201
|
+
regexp_parser (2.8.3)
|
|
202
|
+
reline (0.4.1)
|
|
203
|
+
io-console (~> 0.5)
|
|
204
|
+
rexml (3.2.6)
|
|
205
|
+
rspec (3.12.0)
|
|
206
|
+
rspec-core (~> 3.12.0)
|
|
207
|
+
rspec-expectations (~> 3.12.0)
|
|
208
|
+
rspec-mocks (~> 3.12.0)
|
|
209
|
+
rspec-core (3.12.2)
|
|
210
|
+
rspec-support (~> 3.12.0)
|
|
211
|
+
rspec-expectations (3.12.3)
|
|
212
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
213
|
+
rspec-support (~> 3.12.0)
|
|
214
|
+
rspec-mocks (3.12.6)
|
|
215
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
216
|
+
rspec-support (~> 3.12.0)
|
|
217
|
+
rspec-support (3.12.1)
|
|
218
|
+
rubocop (1.50.2)
|
|
219
|
+
json (~> 2.3)
|
|
220
|
+
parallel (~> 1.10)
|
|
221
|
+
parser (>= 3.2.0.0)
|
|
222
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
223
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
224
|
+
rexml (>= 3.2.5, < 4.0)
|
|
225
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
|
226
|
+
ruby-progressbar (~> 1.7)
|
|
227
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
228
|
+
rubocop-ast (1.30.0)
|
|
229
|
+
parser (>= 3.2.1.0)
|
|
230
|
+
rubocop-capybara (2.19.0)
|
|
231
|
+
rubocop (~> 1.41)
|
|
232
|
+
rubocop-config-umbrellio (1.50.0.85)
|
|
233
|
+
rubocop (~> 1.50.0)
|
|
234
|
+
rubocop-performance (~> 1.17.0)
|
|
235
|
+
rubocop-rails (~> 2.19.0)
|
|
236
|
+
rubocop-rake (~> 0.6.0)
|
|
237
|
+
rubocop-rspec (~> 2.20.0)
|
|
238
|
+
rubocop-sequel (~> 0.3.3)
|
|
239
|
+
rubocop-performance (1.17.1)
|
|
240
|
+
rubocop (>= 1.7.0, < 2.0)
|
|
241
|
+
rubocop-ast (>= 0.4.0)
|
|
242
|
+
rubocop-rails (2.19.1)
|
|
243
|
+
activesupport (>= 4.2.0)
|
|
244
|
+
rack (>= 1.1)
|
|
245
|
+
rubocop (>= 1.33.0, < 2.0)
|
|
246
|
+
rubocop-rake (0.6.0)
|
|
247
|
+
rubocop (~> 1.0)
|
|
248
|
+
rubocop-rspec (2.20.0)
|
|
249
|
+
rubocop (~> 1.33)
|
|
250
|
+
rubocop-capybara (~> 2.17)
|
|
251
|
+
rubocop-sequel (0.3.4)
|
|
252
|
+
rubocop (~> 1.0)
|
|
253
|
+
ruby-next-core (1.0.0)
|
|
254
|
+
ruby-progressbar (1.13.0)
|
|
255
|
+
ruby2_keywords (0.0.5)
|
|
256
|
+
serverengine (2.1.1)
|
|
257
|
+
sigdump (~> 0.2.2)
|
|
258
|
+
set (1.0.4)
|
|
259
|
+
sigdump (0.2.5)
|
|
260
|
+
sneakers (2.12.0)
|
|
261
|
+
bunny (~> 2.14)
|
|
262
|
+
concurrent-ruby (~> 1.0)
|
|
263
|
+
rake (~> 12.3)
|
|
264
|
+
serverengine (~> 2.1.0)
|
|
265
|
+
thor
|
|
266
|
+
sorted_set (1.0.3)
|
|
267
|
+
rbtree
|
|
268
|
+
set (~> 1.0)
|
|
269
|
+
stringio (3.1.0)
|
|
270
|
+
tainbox (2.1.2)
|
|
271
|
+
activesupport
|
|
272
|
+
thor (1.3.0)
|
|
273
|
+
timeout (0.4.1)
|
|
274
|
+
tzinfo (2.0.6)
|
|
275
|
+
concurrent-ruby (~> 1.0)
|
|
276
|
+
unicode-display_width (2.5.0)
|
|
277
|
+
webrick (1.8.1)
|
|
278
|
+
websocket-driver (0.7.6)
|
|
279
|
+
websocket-extensions (>= 0.1.0)
|
|
280
|
+
websocket-extensions (0.1.5)
|
|
281
|
+
yabeda (0.12.0)
|
|
282
|
+
anyway_config (>= 1.0, < 3)
|
|
283
|
+
concurrent-ruby
|
|
284
|
+
dry-initializer
|
|
285
|
+
zeitwerk (2.6.12)
|
|
286
|
+
|
|
287
|
+
PLATFORMS
|
|
288
|
+
arm64-darwin-22
|
|
289
|
+
x86_64-linux
|
|
290
|
+
|
|
291
|
+
DEPENDENCIES
|
|
292
|
+
pry
|
|
293
|
+
rspec
|
|
294
|
+
rubocop-config-umbrellio
|
|
295
|
+
yabeda-rabbit_messaging!
|
|
296
|
+
|
|
297
|
+
BUNDLED WITH
|
|
298
|
+
2.4.21
|
data/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Umbrellio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Yabeda::RabbitMessaging
|
|
2
|
+
|
|
3
|
+
Built-in metrics for [TableSync](https://github.com/umbrellio/table_sync) out of the box!
|
|
4
|
+
Patch [rabbit_messaging](https://github.com/umbrellio/rabbit_messaging) gem.
|
|
5
|
+
Works through [Yabeda Framework](https://github.com/yabeda-rb).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem "rabbit_messaging"
|
|
11
|
+
gem "table_sync"
|
|
12
|
+
...
|
|
13
|
+
gem "yabeda-rabbit_messaging"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
And then execute:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
$ bundle
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
After application launch gem patch `Rabbit::Receiving::Job` class to collect the metrics.
|
|
23
|
+
|
|
24
|
+
## Metrics
|
|
25
|
+
|
|
26
|
+
Metrics representing state of TableSync receiving jobs processing:
|
|
27
|
+
|
|
28
|
+
- Total number of executed jobs: `rabbit_messages_total` (segmented by `exchange`, `routing_key` and `success` status)
|
|
29
|
+
- Duration of executed jobs: `rabbit_messages_duration` (segmented by `exchange`, `routing_key` and `success` status)
|
|
30
|
+
|
|
31
|
+
## Contributing
|
|
32
|
+
|
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/umbrellio/table_sync.
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
Released under MIT License.
|
|
38
|
+
|
|
39
|
+
## Authors
|
|
40
|
+
|
|
41
|
+
Team Umbrellio
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
<a href="https://github.com/umbrellio/">
|
|
46
|
+
<img style="float: left;" src="https://umbrellio.github.io/Umbrellio/supported_by_umbrellio.svg" alt="Supported by Umbrellio" width="439" height="72">
|
|
47
|
+
</a>
|
data/Rakefile
ADDED
data/bin/console
ADDED
data/bin/setup
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Patch to get metrics from Rabbit::Receiving::Job
|
|
4
|
+
# https://github.com/umbrellio/rabbit_messaging/blob/master/lib/rabbit/receiving/job.rb
|
|
5
|
+
module Yabeda
|
|
6
|
+
module RabbitMessaging
|
|
7
|
+
module JobPatch
|
|
8
|
+
def perform(message, arguments)
|
|
9
|
+
duration = Benchmark.realtime { super(message, arguments) }
|
|
10
|
+
ensure
|
|
11
|
+
labels = arguments.slice(:exchange, :routing_key)
|
|
12
|
+
|
|
13
|
+
if labels.present?
|
|
14
|
+
labels[:success] = duration.present?
|
|
15
|
+
|
|
16
|
+
Yabeda.rabbit_messages_total.increment(labels)
|
|
17
|
+
Yabeda.rabbit_messages_duration.measure(labels, duration) if duration
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "active_support"
|
|
4
|
+
require "benchmark"
|
|
5
|
+
require "yabeda"
|
|
6
|
+
require "rabbit_messaging"
|
|
7
|
+
|
|
8
|
+
require "yabeda/rabbit_messaging/job_patch"
|
|
9
|
+
require "yabeda/rabbit_messaging/version"
|
|
10
|
+
|
|
11
|
+
if defined?(Yabeda)
|
|
12
|
+
Yabeda.configure do
|
|
13
|
+
counter :rabbit_messages_total do
|
|
14
|
+
comment "A counter of the total number of messages by exchange."
|
|
15
|
+
tags %i[exchange routing_key success]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
histogram :rabbit_messages_duration do
|
|
19
|
+
comment "A histogram of the messages latency."
|
|
20
|
+
buckets [0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 60]
|
|
21
|
+
tags %i[exchange routing_key success]
|
|
22
|
+
unit :seconds
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
if defined?(Rabbit::Receiving::Job)
|
|
27
|
+
Rabbit::Receiving::Job.prepend(Yabeda::RabbitMessaging::JobPatch)
|
|
28
|
+
end
|
|
29
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: yabeda-rabbit_messaging
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Stepan Kirushkin
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2023-12-19 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rabbit_messaging
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0.6'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0.6'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: yabeda
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0.8'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0.8'
|
|
41
|
+
description: Easy collect your TableSync metrics.
|
|
42
|
+
email:
|
|
43
|
+
- stepan.kirushkin@gmail.com
|
|
44
|
+
executables: []
|
|
45
|
+
extensions: []
|
|
46
|
+
extra_rdoc_files: []
|
|
47
|
+
files:
|
|
48
|
+
- ".github/workflows/test.yml"
|
|
49
|
+
- ".gitignore"
|
|
50
|
+
- ".rubocop.yml"
|
|
51
|
+
- CHANGELOG.md
|
|
52
|
+
- Gemfile
|
|
53
|
+
- Gemfile.lock
|
|
54
|
+
- LICENSE.md
|
|
55
|
+
- README.md
|
|
56
|
+
- Rakefile
|
|
57
|
+
- bin/console
|
|
58
|
+
- bin/setup
|
|
59
|
+
- lib/yabeda/rabbit_messaging.rb
|
|
60
|
+
- lib/yabeda/rabbit_messaging/job_patch.rb
|
|
61
|
+
- lib/yabeda/rabbit_messaging/version.rb
|
|
62
|
+
homepage: https://github.com/umbrellio/yabeda-rabbit_messaging
|
|
63
|
+
licenses:
|
|
64
|
+
- MIT
|
|
65
|
+
metadata:
|
|
66
|
+
homepage_uri: https://github.com/umbrellio/yabeda-rabbit_messaging
|
|
67
|
+
source_code_uri: https://github.com/umbrellio/yabeda-rabbit_messaging
|
|
68
|
+
changelog_uri: https://github.com/umbrellio/yabeda-rabbit_messaging/blob/master/CHANGELOG.md
|
|
69
|
+
post_install_message:
|
|
70
|
+
rdoc_options: []
|
|
71
|
+
require_paths:
|
|
72
|
+
- lib
|
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
|
+
requirements:
|
|
75
|
+
- - ">="
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: 2.5.0
|
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
requirements: []
|
|
84
|
+
rubygems_version: 3.4.19
|
|
85
|
+
signing_key:
|
|
86
|
+
specification_version: 4
|
|
87
|
+
summary: Yabeda plugin for rabbit_messaging gem.
|
|
88
|
+
test_files: []
|