karafka-core 2.2.1 → 2.2.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/karafka/core/monitoring/statistics_decorator.rb +9 -4
- data/lib/karafka/core/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 267d7bea7b3b01122363dfe4d2157f9e400b89b375a8f21c61e913dfb54b89e6
         | 
| 4 | 
            +
              data.tar.gz: f5b5b6d2b0e253aa3df2444fbd02aebae91b232e66b836f895128173eab481af
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2d5a57339a3259cd1561af52e33eb31b592d8e7b59201d3394a8f58f75ddd5c8acd835b94a8c9d50a93f48137191a5bb9d0570002234f2593652ed16b76a9b81
         | 
| 7 | 
            +
              data.tar.gz: 3d00d4800f4c9ac425fd3f951b7bdee94a407a23d009c921f2c64799f32e36ea936814235dec0df922941036361c500e65fcda210aaf983c38ec9f3bf00c09e5
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | Binary file | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,8 @@ | |
| 1 1 | 
             
            # Karafka core changelog
         | 
| 2 2 |  | 
| 3 | 
            +
            ### 2.2.2 (2023-09-11)
         | 
| 4 | 
            +
            - [Fix] Reuse previous frozen duration as a base for incoming computation.
         | 
| 5 | 
            +
             | 
| 3 6 | 
             
            ## 2.2.1 (2023-09-10)
         | 
| 4 7 | 
             
            - Optimize statistics decorator by minimizing number of new objects created.
         | 
| 5 8 | 
             
            - Expand the decoration to include new value `_fd` providing freeze duration in milliseconds. This value informs us for how many consecutive ms the given value did not change. It can be useful for detecting values that should change once in a while but are stale.
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
| @@ -61,13 +61,17 @@ module Karafka | |
| 61 61 | 
             
                    # @return [Object] the diff if the values were numerics or the current scope
         | 
| 62 62 | 
             
                    def diff(previous, current)
         | 
| 63 63 | 
             
                      if current.is_a?(Hash)
         | 
| 64 | 
            +
                        filled_previous = previous || EMPTY_HASH
         | 
| 65 | 
            +
                        filled_current = current || EMPTY_HASH
         | 
| 66 | 
            +
             | 
| 64 67 | 
             
                        # @note We cannot use #each_key as we modify the content of the current scope
         | 
| 65 68 | 
             
                        #   in place (in case it's a hash)
         | 
| 66 69 | 
             
                        current.keys.each do |key|
         | 
| 67 70 | 
             
                          append(
         | 
| 68 | 
            -
                             | 
| 71 | 
            +
                            filled_previous,
         | 
| 72 | 
            +
                            filled_current,
         | 
| 69 73 | 
             
                            key,
         | 
| 70 | 
            -
                            diff( | 
| 74 | 
            +
                            diff(filled_previous[key], filled_current[key])
         | 
| 71 75 | 
             
                          )
         | 
| 72 76 | 
             
                        end
         | 
| 73 77 | 
             
                      end
         | 
| @@ -84,17 +88,18 @@ module Karafka | |
| 84 88 |  | 
| 85 89 | 
             
                    # Appends the result of the diff to a given key as long as the result is numeric
         | 
| 86 90 | 
             
                    #
         | 
| 91 | 
            +
                    # @param previous [Hash] previous scope
         | 
| 87 92 | 
             
                    # @param current [Hash] current scope
         | 
| 88 93 | 
             
                    # @param key [Symbol] key based on which we were diffing
         | 
| 89 94 | 
             
                    # @param result [Object] diff result
         | 
| 90 | 
            -
                    def append(current, key, result)
         | 
| 95 | 
            +
                    def append(previous, current, key, result)
         | 
| 91 96 | 
             
                      return unless result.is_a?(Numeric)
         | 
| 92 97 | 
             
                      return if current.frozen?
         | 
| 93 98 |  | 
| 94 99 | 
             
                      freeze_duration_key = "#{key}_fd"
         | 
| 95 100 |  | 
| 96 101 | 
             
                      if result.zero?
         | 
| 97 | 
            -
                        current[freeze_duration_key]  | 
| 102 | 
            +
                        current[freeze_duration_key] = previous[freeze_duration_key] || 0
         | 
| 98 103 | 
             
                        current[freeze_duration_key] += @change_d
         | 
| 99 104 | 
             
                      else
         | 
| 100 105 | 
             
                        current[freeze_duration_key] = 0
         | 
    
        data/lib/karafka/core/version.rb
    CHANGED
    
    
    
        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.2. | 
| 4 | 
            +
              version: 2.2.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Maciej Mensfeld
         | 
| @@ -35,7 +35,7 @@ cert_chain: | |
| 35 35 | 
             
              AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
         | 
| 36 36 | 
             
              msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
         | 
| 37 37 | 
             
              -----END CERTIFICATE-----
         | 
| 38 | 
            -
            date: 2023-09- | 
| 38 | 
            +
            date: 2023-09-11 00:00:00.000000000 Z
         | 
| 39 39 | 
             
            dependencies:
         | 
| 40 40 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 41 41 | 
             
              name: concurrent-ruby
         | 
| @@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 148 148 | 
             
                - !ruby/object:Gem::Version
         | 
| 149 149 | 
             
                  version: '0'
         | 
| 150 150 | 
             
            requirements: []
         | 
| 151 | 
            -
            rubygems_version: 3.4. | 
| 151 | 
            +
            rubygems_version: 3.4.19
         | 
| 152 152 | 
             
            signing_key: 
         | 
| 153 153 | 
             
            specification_version: 4
         | 
| 154 154 | 
             
            summary: Karafka ecosystem core modules
         | 
    
        metadata.gz.sig
    CHANGED
    
    | Binary file |