Sha256: e6e713d83acf354aea493fa1ed51d6fb4e9841128d21344a8372061fec4f0add

Contents?: true

Size: 769 Bytes

Versions: 9

Compression:

Stored size: 769 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Web
    module Management
      module Migrations
        # Adds bytes_sent and bytes_received to all the aggregated metrics samples, so we have
        # charts that do not have to fill gaps or check anything
        class FillMissingReceivedAndSentBytesInConsumersMetrics < Base
          self.versions_until = '1.1.0'
          self.type = :consumers_metrics

          # @param state [Hash] metrics state
          def migrate(state)
            state[:aggregated].each_value do |metrics|
              metrics.each do |metric|
                metric.last[:bytes_sent] = 0
                metric.last[:bytes_received] = 0
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
karafka-web-0.9.1 lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb
karafka-web-0.9.0 lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb
karafka-web-0.9.0.rc3 lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb
karafka-web-0.9.0.rc2 lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb
karafka-web-0.9.0.rc1 lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb
karafka-web-0.8.2 lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb
karafka-web-0.8.1 lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb
karafka-web-0.8.0 lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb
karafka-web-0.8.0.rc1 lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb