Module Luv.Resource
val uptime : unit -> (float, Error.t) Result.result
Evaluates to the current uptime.
Binds
uv_uptime
. Seesysinfo(2)
.
val loadavg : unit -> float * float * float
Evaluates to the load average.
Binds
uv_loadavg
. Seesysinfo(2)
.
val free_memory : unit -> Unsigned.uint64
Evaluates to the amount of free memory, in bytes.
Binds
uv_get_free_memory
. Seesysinfo(2)
.
val total_memory : unit -> Unsigned.uint64
Evaluates to the total amount of memory, in bytes.
Binds
uv_get_total_memory
. Seesysinfo(2)
.
val constrained_memory : unit -> Unsigned.uint64 option
Binds http://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory.
Requires libuv 1.29.0.
Feature check:
Luv.Require.(has get_constrained_memory)
module Priority : sig ... end
Priority constants.
val getpriority : int -> (int, Error.t) Result.result
Evaluates to the priority of the process with the given pid.
Binds
uv_os_getpriority
. Seegetpriority(3p)
.Requires libuv 1.23.0.
Feature check:
Luv.Require.(has os_priority)
val setpriority : int -> int -> (unit, Error.t) Result.result
Sets the priority of the process with the given pid.
Binds
uv_os_setpriority
. Seesetpriority(3p)
.Requires libuv 1.23.0.
Feature check:
Luv.Require.(has os_priority)
val resident_set_memory : unit -> (Unsigned.size_t, Error.t) Result.result
Evaluates to the resident set size for the current process.
Binds
uv_resident_set_memory
.
type timeval
=
{
sec : Signed.Long.t;
usec : Signed.Long.t;
}
Binds
uv_timeval_t
.
type rusage
=
{
utime : timeval;
stime : timeval;
maxrss : Unsigned.uint64;
ixrss : Unsigned.uint64;
idrss : Unsigned.uint64;
isrss : Unsigned.uint64;
minflt : Unsigned.uint64;
majflt : Unsigned.uint64;
nswap : Unsigned.uint64;
inblock : Unsigned.uint64;
oublock : Unsigned.uint64;
msgsnd : Unsigned.uint64;
msgrcv : Unsigned.uint64;
nsignals : Unsigned.uint64;
nvcsw : Unsigned.uint64;
nivcsw : Unsigned.uint64;
}
Binds
uv_rusage_t
.See
getrusage(2)
.
val getrusage : unit -> (rusage, Error.t) Result.result
Binds
uv_getrusage
.See
getrusage(3p)
.