Apero.Proc (Apero v3.0.0)

Copy Markdown View Source

Process and executable utilities for Apero (pure-Elixir subset).

Provides helpers for checking command availability, finding executables, and VM introspection. All functions are pure Elixir/Erlang — no shell execution involved.

For shell-based operations (process listing, signalling, logs, lsof, fuser) see Trebejo.Proc.

Summary

Functions

Filters a list of commands to only those available on the system.

Returns true if the given command exists in the system PATH.

Returns a map of command => path for all found commands.

Returns the OS process ID of the BEAM VM.

Returns the number of scheduler threads.

Returns the VM memory usage in bytes.

Returns the VM uptime in milliseconds.

Returns the full path of a command if found, or nil.

Functions

available_commands(commands)

@spec available_commands([String.t()]) :: [String.t()]

Filters a list of commands to only those available on the system.

command_exists?(cmd)

@spec command_exists?(String.t()) :: boolean()

Returns true if the given command exists in the system PATH.

locate_commands(commands)

@spec locate_commands([String.t()]) :: %{required(String.t()) => String.t()}

Returns a map of command => path for all found commands.

os_pid()

@spec os_pid() :: non_neg_integer()

Returns the OS process ID of the BEAM VM.

scheduler_count()

@spec scheduler_count() :: non_neg_integer()

Returns the number of scheduler threads.

vm_memory()

@spec vm_memory() :: non_neg_integer()

Returns the VM memory usage in bytes.

vm_uptime()

@spec vm_uptime() :: non_neg_integer()

Returns the VM uptime in milliseconds.

which(cmd)

@spec which(String.t()) :: String.t() | nil

Returns the full path of a command if found, or nil.