Module: Karafka::Web::Ui::Models::Processes
- Extended by:
- Core::Helpers::Time
- Defined in:
- lib/karafka/web/ui/models/processes.rb
Overview
Note:
Active also includes processes stopped recently. We use it to provide better visibility via UI.
Represents the active processes data
Class Method Summary collapse
-
.active(state) ⇒ Array<Process>
Returns the active processes in an array and alongside of that the current state of the system.
-
.all(state) ⇒ Array<Process>
Returns processes that are running or recently shutdown.
Class Method Details
.active(state) ⇒ Array<Process>
Returns the active processes in an array and alongside of that the current state of the system. We use those together in the UI and it would be expensive to pick it up while we’ve already had it. Active means it is running (or recently shutdown) and it has current schema. Basically any process about which we can reason
34 35 36 |
# File 'lib/karafka/web/ui/models/processes.rb', line 34 def active(state) all(state).delete_if { |process| !process.schema_compatible? } end |
.all(state) ⇒ Array<Process>
Returns processes that are running or recently shutdown. It may also return processes with incompatible schema.
18 19 20 21 22 23 24 25 |
# File 'lib/karafka/web/ui/models/processes.rb', line 18 def all(state) = fetch_reports(state) = squash_processes_data() processes = .map(&:payload) evict_expired_processes(processes) processes = sort_processes(processes) processes.map { |process_hash| Process.new(process_hash) } end |