Class: Karafka::Web::Management::Migrations::ConsumersMetrics::SetInitial

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/web/management/migrations/consumers_metrics/0_set_initial.rb

Overview

Initial migration that sets the consumers metrics initial first state. This is the basic of metrics as they were when they were introduced.

Instance Method Summary collapse

Methods inherited from Base

applicable?, index, migrate, sorted_descendants

Instance Method Details

#migrate(state) ⇒ Object

Parameters:

  • state (Hash)

    initial empty state



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/karafka/web/management/migrations/consumers_metrics/0_set_initial.rb', line 17

def migrate(state)
  state.merge!(
    aggregated: {
      days: [],
      hours: [],
      minutes: [],
      seconds: []
    },
    consumer_groups: {
      days: [],
      hours: [],
      minutes: [],
      seconds: []
    },
    dispatched_at: float_now
  )
end