Up

Module Cpu_use

A module for getting a process's CPU use.

Signature

type t
val get : ?pid:Core.Std.Pid.t -> unit -> t

get returns a Cpu_use.t for the given pid or the current processes's pid, if none given. Note that the cpu_use given by this initial value will probably be invalid.

val update_exn : t -> unit

update_exn updates a Cpu_use.t. It will fail if the process no longer exists.

val cpu_use : t -> float

cpu_use gives an estimated CPU usage (between 0 and 1) in the time period between the last 2 calls to update_exn.

val resident_mem_use_in_kb : t -> float
val age : t -> Core.Std.Time.Span.t
val fds : t -> int