package rusage

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t = {
  1. utime : float;
    (*

    User CPU time used (seconds). The total amount of time spent executing in user mode.

    *)
  2. stime : float;
    (*

    System CPU time used (seconds). The total amount of time spent executing in kernel mode.

    *)
  3. maxrss : int64;
    (*

    Maximum resident set size used (kilobytes). If who = Children, this is the resident set size of the largest child, not the maximum resident set size of the process tree.

    *)
  4. ixrss : int64;
    (*

    Integral shared memory size. Currently unused on Linux.

    *)
  5. idrss : int64;
    (*

    Integral unshared data size. Currently unused on Linux.

    *)
  6. isrss : int64;
    (*

    Integral unshared stack size. Currently unused on Linux.

    *)
  7. minflt : int64;
    (*

    Minor page faults. The number of page faults serviced without any I/O activity. Here, I/O activity is avoided by "reclaiming" a page frame form the list of pages awaiting re-allocation.

    *)
  8. majflt : int64;
    (*

    Major page faults. The number of page faults that required I/O activity.

    *)
  9. nswap : int64;
    (*

    Swaps. Currently unused on Linux.

    *)
  10. inblock : int64;
    (*

    Block input operations. The number of times the filesystem had to perform input.

    *)
  11. oublock : int64;
    (*

    Block output operations. The number of times the filesystem had to perform output.

    *)
  12. msgsnd : int64;
    (*

    IPC messages sent. Currently unused on Linux.

    *)
  13. msgrcv : int64;
    (*

    IPC messages received. Currently unused on Linux.

    *)
  14. nsignals : int64;
    (*

    Signals received. Currently unused on Linux.

    *)
  15. nvcsw : int64;
    (*

    Voluntary context switches. The number of times a context switch resulted due to a process voluntarily giving up the processor before its time slice was completed (usually to await availability of a resource).

    *)
  16. nivcsw : int64;
    (*

    Involuntary context switches. The number of times a context switch resulted due to a higher priority process becoming runnable or because the current process exceeded its time slice.

    *)
}

rusage result struct. See manpage for the getrusage sys-call for more details.

type who =
  1. | Self
    (*

    Return resource usage statistics for the calling process, which is the sum of resources used by all threads in the process.

    *)
  2. | Children
    (*

    Return resource usage statistics for all children of the calling process that have terminated and been waited for. These statistics will include the resources used by grandchildren, and further removed descendants, if all of the intervening descendants waited on their terminated children.

    *)
val get : who -> t