rusage

package
v3.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package rusage is a small wrapper around the POSIX system call getrusage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resources

type Resources struct {
	// User-mode time and system-mode time
	Utime, Stime time.Duration

	// Maximum resident segment size, in platform-dependent units:
	// - Linux, Dragonfly, FreeBSD, NetBSD, OpenBSD, AIX: kilobytes
	// - Darwin: bytes
	// - Solaris, Illumos: pages
	MaxRSS int64

	// Counts of minor and major page faults
	MinorFaults, MajorFaults int64

	// Counts of file system performing input / output
	FSInBlocks, FSOutBlocks int64
}

Resources summarises used system resources (mainly CPU time and memory). Some fields that appear in various rusage structs are omitted because we mainly care about Linux.

func Stats

func Stats() (*Resources, error)

Stats returns the resources used by the program according to getrusage(2).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL