class

Ctop::Collectors::Manager

Inherits Reference < Object

Unified manager for all system metric collectors.

Bundles CPU, Memory, Network, and Process collectors and provides a single collect method that returns all metrics at once.

Designed to be called on timer tick events in the main event loop:

termisu = Termisu.new
termisu.enable_timer(1.second)
collectors = Ctop::Collectors::Manager.new

termisu.each_event do |event|
  case event
  when Termisu::Event::Tick
    metrics = collectors.collect
    # Update panels with metrics.cpu, metrics.memory, etc.
    termisu.render
  when Termisu::Event::Key
    break if event.ctrl_c?
  end
end

Constructors

Instance methods

collect(proc_limit : Int32) : Ctop::Snapshots::Metrics

Collect with custom process limit.

Source
collect

Collect all system metrics at once.

Returns a Metrics record containing snapshots from all collectors. Call this on each timer tick to refresh the UI.

Source
memory
Source
proc
Source