Class: Karafka::Web::Management::Migrations::SplitListenersIntoActiveAndPausedInStates
- Inherits:
-
Base
- Object
- Base
- Karafka::Web::Management::Migrations::SplitListenersIntoActiveAndPausedInStates
- Defined in:
- lib/karafka/web/management/migrations/1704722380_split_listeners_into_active_and_paused_in_states.rb
Overview
Since we have introduced notion of pause listeners, we need to reflect this in the UI, so the scaling changes are visible
Instance Method Summary collapse
Methods inherited from Base
applicable?, index, migrate, sorted_descendants
Instance Method Details
#migrate(state) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/karafka/web/management/migrations/1704722380_split_listeners_into_active_and_paused_in_states.rb', line 14 def migrate(state) listeners = if state[:stats].key?(:listeners) state[:stats][:listeners].to_i elsif state[:stats].key?(:listeners_count) state[:stats][:listeners_count].to_i else 0 end state[:stats][:listeners] = { active: listeners, standby: 0 } end |