Etop.Reader (Etop v0.5.0)

Helpers for Etop.

Link to this section Summary

Functions

Get the number of CPU Cores.

Handle the timer timeout.

Fetch the initial CPU information.

Fetch the top stats from either a current node or a remote node.

Link to this section Functions

Get the number of CPU Cores.

Link to this function

handle_collect(state, stats)

Handle the timer timeout.

Collect and report the Top information.

Link to this function

remote_cpu_info(map)

Fetch the initial CPU information.

Gets the os_pid and core count.

Link to this function

remote_stats(state)

Fetch the top stats from either a current node or a remote node.

Gets the following information and sends {:result, info_map} to the calling process:

%{
  procs: List of Process.info(pid) with memory stats added,
  nprocs: total process count,
  memory: overall memory information,
  runq: length of the run queue,
  util2: contents of "/proc/<os-pid>/stat",
}

NOTE: remote nodes are not working.

Link to this function

sort(list, field \\ :reductions_diff, field_fn \\ fn field -> &(elem(&1, 1)[field]) end, sorter_fn \\ &>/2)

Configurable sort.

Arguments

  • list - the enumerable to be sorted.
  • field (:reductions_diff) - the field to be sorted on.
  • field_fn (fn field -> &elem(&1, 1)[field] end) - function to get the field.
  • sorter_fn (&>/2) -> Sort comparator (default descending)