karafka-core 2.0.7 → 2.0.8

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
  SHA256:
3
- metadata.gz: 158fcf590bf58fc10f8c47c5f9b9e8a256db4df8bfa842780cd20b6859c82392
4
- data.tar.gz: 33025b3aaae92b63dffd21bf1820937d768cae4f8103701c963903e2add50fa6
3
+ metadata.gz: 89262ad9172da20cb645406674d90025637d7f4aea8e73379d2d39d475ed9eaf
4
+ data.tar.gz: f10d0f1748fc69859c9b1661c490304d23e8506f550eff2bc7446045d9fd2ff1
5
5
  SHA512:
6
- metadata.gz: ebd3106bfe9f3ee67c1fca1ed6c871a2b7d18d03bb6a1dd9be4922777cb0bed1362047550a1a146491e9402fd9da61d6a37baf6aef99d6e303410702e7cedb3b
7
- data.tar.gz: 89fab64ee5a909d0e05fbf179b690cc4fa75153d13cdbfe06e22d8b2d66b11fe4484641897ce95cb1a21e48e05746e29313a0d4157cc0a38d5dbe169d21ecc7f
6
+ metadata.gz: 3042fe634fccbcbb9e9331c0fab4b6637d8077c7cbd3695aa2802aac8b2d230be21eb1093bf4803886402a0bec292bd40078a74f115a85e532470378aaf3fd31
7
+ data.tar.gz: 46d394f39d1cdecb581e92f6786ee6780b7aa3ca80815337f7638441e0b3e6ce3bb477e09a0c89bc285d77acc1803a2b0393d8b63e68c75f14be694bf1c53c11
checksums.yaml.gz.sig CHANGED
@@ -1 +1,3 @@
1
- ��*NMQ��<���iqIgu��B�s+W�]���$���`���X��左q�8��4�.9�}�����ᡯl|Y :��C/�-*t2��Y��{s����S[U�`c�$��-?VuE��W���!��`d ���>+-�#��8jBf�����g���<��7��hv�c����o�M�um�������t�<�T�FS!��:(�'�r��cmÂ��<���w�M��Ŝ�i����=�`�թZ�kɄ��JVu�@<�0����G )�ǧ������Z>�Ȅ�ю�|�T�at��+��O��t��&mut+}�����������Z����8�hu�M���Tb��l�?��㿞���<��y-?�+E`Y�F�X��$
1
+ �U 4��aJ�@� H
2
+ �Z�P&�]��o�w�<s8}^�k'l�'���Wi�;�X��É[�G��0_��㕽�#�
3
+ �����v������S ��K�@߲�R���5a�R���׶.�Om����"~?�kh�1������x̂�,P�.����L��-U6l �~pђ���Mɇ*4������DLe�NNp�1�n����Z���st1�D��R2,wأ����� v�:!M�Ә�#��F/���bn������lRPrAc#n/��<Z��_O��v�0�:�RvJ�����YG���;4H�&�0,ɶR����]�xA�P�����ah."�c�3l�ޑ�SUI0�j��
@@ -16,11 +16,12 @@ jobs:
16
16
  fail-fast: false
17
17
  matrix:
18
18
  ruby:
19
+ - '3.2'
19
20
  - '3.1'
20
21
  - '3.0'
21
22
  - '2.7'
22
23
  include:
23
- - ruby: '3.1'
24
+ - ruby: '3.2'
24
25
  coverage: 'true'
25
26
  steps:
26
27
  - uses: actions/checkout@v3
@@ -54,7 +55,7 @@ jobs:
54
55
  - name: Set up Ruby
55
56
  uses: ruby/setup-ruby@v1
56
57
  with:
57
- ruby-version: 3.1
58
+ ruby-version: 3.2
58
59
  - name: Install latest bundler
59
60
  run: gem install bundler --no-document
60
61
  - name: Install Diffend plugin
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.3
1
+ 3.2.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Karafka core changelog
2
2
 
3
+ ## 2.0.8 (2023-01-07)
4
+ - Add `Karafka::Core::Helpers::Time` utility for time reporting.
5
+
3
6
  ## 2.0.7 (2022-12-18)
4
7
  - Allow for recompilation of config upon injecting new config nodes.
5
8
  - Compile given config scope automatically after it is defined.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-core (2.0.7)
4
+ karafka-core (2.0.8)
5
5
  concurrent-ruby (>= 1.1)
6
6
  rdkafka (>= 0.12)
7
7
 
@@ -22,8 +22,8 @@ GEM
22
22
  ffi (1.15.5)
23
23
  i18n (1.12.0)
24
24
  concurrent-ruby (~> 1.0)
25
- mini_portile2 (2.8.0)
26
- minitest (5.16.3)
25
+ mini_portile2 (2.8.1)
26
+ minitest (5.17.0)
27
27
  rake (13.0.6)
28
28
  rdkafka (0.12.0)
29
29
  ffi (~> 1.15)
@@ -35,14 +35,14 @@ GEM
35
35
  rspec-mocks (~> 3.12.0)
36
36
  rspec-core (3.12.0)
37
37
  rspec-support (~> 3.12.0)
38
- rspec-expectations (3.12.0)
38
+ rspec-expectations (3.12.1)
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
40
  rspec-support (~> 3.12.0)
41
- rspec-mocks (3.12.0)
41
+ rspec-mocks (3.12.1)
42
42
  diff-lcs (>= 1.2.0, < 2.0)
43
43
  rspec-support (~> 3.12.0)
44
44
  rspec-support (3.12.0)
45
- simplecov (0.21.2)
45
+ simplecov (0.22.0)
46
46
  docile (~> 1.1)
47
47
  simplecov-html (~> 0.11)
48
48
  simplecov_json_formatter (~> 0.1)
@@ -63,4 +63,4 @@ DEPENDENCIES
63
63
  simplecov
64
64
 
65
65
  BUNDLED WITH
66
- 2.3.26
66
+ 2.4.2
File without changes
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ module Core
5
+ # Namespace for some small utilities used across the ecosystem
6
+ module Helpers
7
+ # Time related methods used across Karafka
8
+ module Time
9
+ # @return [Float] current monotonic time in milliseconds
10
+ def monotonic_now
11
+ ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) * 1_000
12
+ end
13
+
14
+ # @return [Float] current time in float
15
+ def float_now
16
+ ::Time.now.utc.to_f
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -9,6 +9,8 @@ module Karafka
9
9
  # We do not use any of them by default as our use-case is fairly simple and we do not want
10
10
  # to have too many external dependencies.
11
11
  class Notifications
12
+ include Core::Helpers::Time
13
+
12
14
  attr_reader :name
13
15
 
14
16
  # Raised when someone wants to publish event that was not registered
@@ -112,14 +114,9 @@ module Karafka
112
114
  # Measures time taken to execute a given block and returns it together with the result of
113
115
  # the block execution
114
116
  def measure_time_taken
115
- start = current_time
117
+ start = monotonic_now
116
118
  result = yield
117
- [result, current_time - start]
118
- end
119
-
120
- # @return [Integer] current monotonic time
121
- def current_time
122
- ::Process.clock_gettime(::Process::CLOCK_MONOTONIC, :millisecond)
119
+ [result, monotonic_now - start]
123
120
  end
124
121
  end
125
122
  end
@@ -4,6 +4,6 @@ module Karafka
4
4
  module Core
5
5
  # Current Karafka::Core version
6
6
  # We follow the versioning schema of given Karafka version
7
- VERSION = '2.0.7'
7
+ VERSION = '2.0.8'
8
8
  end
9
9
  end
data/lib/karafka-core.rb CHANGED
@@ -11,6 +11,8 @@
11
11
  karafka/core
12
12
  karafka/core/version
13
13
 
14
+ karafka/core/helpers/time
15
+
14
16
  karafka/core/monitoring
15
17
  karafka/core/monitoring/event
16
18
  karafka/core/monitoring/monitor
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,7 +35,7 @@ cert_chain:
35
35
  Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
36
36
  MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
37
37
  -----END CERTIFICATE-----
38
- date: 2022-12-18 00:00:00.000000000 Z
38
+ date: 2023-01-07 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: concurrent-ruby
@@ -90,7 +90,7 @@ files:
90
90
  - MIT-LICENSE
91
91
  - README.md
92
92
  - certs/cert_chain.pem
93
- - config/errors.yml
93
+ - config/locales/errors.yml
94
94
  - karafka-core.gemspec
95
95
  - lib/karafka-core.rb
96
96
  - lib/karafka/core.rb
@@ -101,6 +101,7 @@ files:
101
101
  - lib/karafka/core/contractable/contract.rb
102
102
  - lib/karafka/core/contractable/result.rb
103
103
  - lib/karafka/core/contractable/rule.rb
104
+ - lib/karafka/core/helpers/time.rb
104
105
  - lib/karafka/core/instrumentation.rb
105
106
  - lib/karafka/core/instrumentation/callbacks_manager.rb
106
107
  - lib/karafka/core/monitoring.rb
@@ -137,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
138
  - !ruby/object:Gem::Version
138
139
  version: '0'
139
140
  requirements: []
140
- rubygems_version: 3.3.26
141
+ rubygems_version: 3.4.1
141
142
  signing_key:
142
143
  specification_version: 4
143
144
  summary: Karafka ecosystem core modules
metadata.gz.sig CHANGED
@@ -1,4 +1,2 @@
1
- �#f�餐Ѡ^�N���-X�hˬ�t�n���9_�Y뾁����,C�iЛ"{���SI,F�=ã�lZw���*� YKj�i���rz�3����ϝG;D���᪯�����7������-V;<%���\&��vJ5>�{���s*v�}�-���Rb�&ۇ�x��.5`��^�v��,��E9�X��˞����.� ����}ǿ-5�� �HI˒�2���_�*Ia��$�*�a��
2
- 2
3
- 6�$6��7[z7�%؍9�Ts���x�=;ïҧo��[���A�|x',�J���R��)Z�\l�����挏B?푹�z�������m�i
4
- ���J]L��o(Ms��4zɜ�]B>�W�N'���]d��Q�Z
1
+ �$ľsvԓ���p����y#���:�����,C��� ����� ��y�iN
2
+ ��&���6�����_ :�g۪V_�bv�e��%�?��h1��ڬ�L��Z���y}{Dn�Ɖ9��n�<c~f�w�O�%������<�E��%ΰH�1�Gʨ@NQ�D���tWn%� ��G�H�+N�@��J�������]��A��*go�.�>��E�$�uZ��wc·7�(h2Q�纎`=���