Class: Karafka::Web::Management::Migrations::ConsumersStates::RenameLagTotalToLagHybrid

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/management/migrations/consumers_states/1706611396_rename_lag_total_to_lag_hybrid.rb

Overview

Renames total lag to hybrid to better represent what it is

Instance Method Summary collapse

Methods inherited from Base

applicable?, index, migrate, sorted_descendants

Instance Method Details

#migrate(state) ⇒ Object

Parameters:

  • state (Hash)


14
15
16
17
# File 'lib/karafka/web/management/migrations/consumers_states/1706611396_rename_lag_total_to_lag_hybrid.rb', line 14

def migrate(state)
  state[:stats][:lag_hybrid] = state[:stats][:lag_total] || 0
  state[:stats].delete(:lag_total)
end