package core_extended

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Process and system stats

type bigint = Big_int.big_int
include sig ... end
val bigint_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> bigint
val sexp_of_bigint : bigint -> Ppx_sexp_conv_lib.Sexp.t
val input_all_with_reused_buffer : unit -> (string -> string) Core.Staged.t
module Process : sig ... end
module Meminfo : sig ... end
module Kstat : sig ... end
module Loadavg : sig ... end
val get_all_procs : unit -> Process.t list

get_all_procs returns a list of all processes on the system

val with_pid_exn : Core.Pid.t -> Process.t

with_pid_exn pid returns a single process that matches pid, or raises Not_found

val with_pid : Core.Pid.t -> Process.t option

with_pid pid returns a single process that matches pid

val with_uid : int -> Process.t list

with_uid uid returns all processes owned by uid

val pgrep : (Process.t -> bool) -> Process.t list

pgrep f returns all processes for which f is true

val pkill : signal:Core.Signal.t -> (Process.t -> bool) -> (Core.Pid.t * (unit, Core.Unix.Error.t) Core.Result.t) list

pkill ~signal f sends the signal to all processes for which f returns true. It returns the list of processes that were signaled, and the resulting errors if any.

val with_username_exn : string -> Process.t list

with_username_exn user calls with_uid after looking up the user's uid

val with_username : string -> Process.t list option

with_username user calls with_uid after looking up the user's uid

val jiffies_per_second_exn : unit -> float

jiffies_per_second_exn. A jiffy "is one tick of the system timer interrupt. It is not an absolute time interval unit, since its duration depends on the clock interrupt frequency of the particular hardware platform."

Further reading: https://secure.wikimedia.org/wikipedia/en/wiki/Jiffy_(time)

val jiffies_per_second : unit -> float option
val meminfo_exn : unit -> Meminfo.t

meminfo_exn queries /proc/meminfo and fills out Meminfo.t. All values in bytes.

val meminfo : unit -> Meminfo.t option
val loadavg_exn : unit -> Loadavg.t

loadavg_exn parses /proc/loadavg.

val loadavg : unit -> Loadavg.t option
module Net : sig ... end
module Mount : sig ... end
val mounts : unit -> Mount.t list
val mounts_of_fstab : unit -> Mount.t list
val supported_filesystems : unit -> string list
val uptime : unit -> Core.Time.Span.t
val process_age : Process.t -> Core.Time.Span.t option
val process_age' : jiffies_per_second:float -> Process.t -> Core.Time.Span.t
OCaml

Innovation. Community. Security.