stats

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: 0BSD Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatCPU

type StatCPU struct {
	// Percent of CPU Usage
	Usage string
	// NumCPU returns the number of logical CPUs usable by the current process.
	//
	// The set of available CPUs is checked by querying the operating system at process startup. Changes to operating system CPU allocation after process startup are not reflected.
	Num int
	// GOARCH is the running program's architecture target: one of 386, amd64, arm, s390x, and so on.
	Arch string
	// Process ID
	PID int
}

func CPU

func CPU() (StatCPU, error)

Get CPU stats

type StatMemory

type StatMemory struct {
	// Alloc is bytes of allocated heap objects.
	Alloc string
	// TotalAlloc is cumulative bytes allocated for heap objects.
	//
	// TotalAlloc increases as heap objects are allocated, but unlike Alloc and HeapAlloc, it does not decrease when objects are freed.
	TotalAlloc string
	// Sys is the total bytes of memory obtained from the OS.
	//
	// Sys is the sum of the XSys fields below. Sys measures the virtual address space reserved by the Go runtime for the heap, stacks, and other internal data structures. It's likely that not all of the virtual address space is backed by physical memory at any given moment, though in general it all was at some point.
	Sys string
	// NumGC is the number of completed GC cycles.
	NumGC uint32
}

func Memory

func Memory() StatMemory

Get Memory stats

Jump to

Keyboard shortcuts

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