package process
Import Path
github.com/gofiber/fiber/v2/internal/gopsutil/process (on go.dev )
Dependency Relation
imports 22 packages , and imported by one package
Package-Level Type Names (total 10)
/* sort by: alphabet | popularity */
type Process (struct)
Fields (only one )
Pid int32
Methods (total 92 )
(*Process) Background () (bool , error )
Background returns true if the process is in background, false otherwise.
(*Process) BackgroundWithContext (ctx context .Context ) (bool , error )
(*Process) CPUAffinity () ([]int32 , error )
CPUAffinity returns CPU affinity of the process.
Notice: Not implemented yet.
(*Process) CPUAffinityWithContext (ctx context .Context ) ([]int32 , error )
(*Process) CPUPercent () (float64 , error )
CPU_Percent returns how many percent of the CPU time this process uses
(*Process) CPUPercentWithContext (ctx context .Context ) (float64 , error )
(*Process) Children () ([]*Process , error )
Children returns a slice of Process of the process.
(*Process) ChildrenWithContext (ctx context .Context ) ([]*Process , error )
(*Process) Cmdline () (string , error )
Cmdline returns the command line arguments of the process as a string with
each argument separated by 0x20 ascii character.
(*Process) CmdlineSlice () ([]string , error )
CmdlineSlice returns the command line arguments of the process as a slice with each
element being an argument.
(*Process) CmdlineSliceWithContext (ctx context .Context ) ([]string , error )
(*Process) CmdlineWithContext (ctx context .Context ) (string , error )
(*Process) Connections () ([]net .ConnectionStat , error )
Connections returns a slice of net.ConnectionStat used by the process.
This returns all kind of the connection. This measn TCP, UDP or UNIX.
(*Process) ConnectionsMax (max int ) ([]net .ConnectionStat , error )
Connections returns a slice of net.ConnectionStat used by the process at most `max`
(*Process) ConnectionsMaxWithContext (ctx context .Context , max int ) ([]net .ConnectionStat , error )
(*Process) ConnectionsWithContext (ctx context .Context ) ([]net .ConnectionStat , error )
(*Process) CreateTime () (int64 , error )
CreateTime returns created time of the process in milliseconds since the epoch, in UTC.
(*Process) CreateTimeWithContext (ctx context .Context ) (int64 , error )
(*Process) Cwd () (string , error )
Cwd returns current working directory of the process.
(*Process) CwdWithContext (ctx context .Context ) (string , error )
(*Process) Exe () (string , error )
Exe returns executable path of the process.
(*Process) ExeWithContext (ctx context .Context ) (string , error )
(*Process) Foreground () (bool , error )
Foreground returns true if the process is in foreground, false otherwise.
(*Process) ForegroundWithContext (ctx context .Context ) (bool , error )
(*Process) Gids () ([]int32 , error )
Gids returns group ids of the process as a slice of the int
(*Process) GidsWithContext (ctx context .Context ) ([]int32 , error )
(*Process) Groups () ([]int32 , error )
Groups returns all group IDs(include supplementary groups) of the process as a slice of the int
(*Process) GroupsWithContext (ctx context .Context ) ([]int32 , error )
(*Process) IOCounters () (*IOCountersStat , error )
IOCounters returns IO Counters.
(*Process) IOCountersWithContext (ctx context .Context ) (*IOCountersStat , error )
(*Process) IOnice () (int32 , error )
IOnice returns process I/O nice value (priority).
(*Process) IOniceWithContext (ctx context .Context ) (int32 , error )
(*Process) IsRunning () (bool , error )
IsRunning returns whether the process is still running or not.
(*Process) IsRunningWithContext (ctx context .Context ) (bool , error )
(*Process) Kill () error
Kill sends SIGKILL to the process.
(*Process) KillWithContext (ctx context .Context ) error
(*Process) MemoryInfo () (*MemoryInfoStat , error )
MemoryInfo returns platform in-dependend memory information, such as RSS, VMS and Swap
(*Process) MemoryInfoEx () (*MemoryInfoExStat , error )
MemoryInfoEx returns platform dependend memory information.
(*Process) MemoryInfoExWithContext (ctx context .Context ) (*MemoryInfoExStat , error )
(*Process) MemoryInfoWithContext (ctx context .Context ) (*MemoryInfoStat , error )
(*Process) MemoryMaps (grouped bool ) (*[]MemoryMapsStat , error )
MemoryMaps get memory maps from /proc/(pid)/smaps
(*Process) MemoryMapsWithContext (ctx context .Context , grouped bool ) (*[]MemoryMapsStat , error )
(*Process) MemoryPercent () (float32 , error )
MemoryPercent returns how many percent of the total RAM this process uses
(*Process) MemoryPercentWithContext (ctx context .Context ) (float32 , error )
(*Process) Name () (string , error )
Name returns name of the process.
(*Process) NameWithContext (ctx context .Context ) (string , error )
(*Process) NetIOCounters (pernic bool ) ([]net .IOCountersStat , error )
NetIOCounters returns NetIOCounters of the process.
(*Process) NetIOCountersWithContext (ctx context .Context , pernic bool ) ([]net .IOCountersStat , error )
(*Process) Nice () (int32 , error )
Nice returns a nice value (priority).
Notice: gopsutil can not set nice value.
(*Process) NiceWithContext (ctx context .Context ) (int32 , error )
(*Process) NumCtxSwitches () (*NumCtxSwitchesStat , error )
NumCtxSwitches returns the number of the context switches of the process.
(*Process) NumCtxSwitchesWithContext (ctx context .Context ) (*NumCtxSwitchesStat , error )
(*Process) NumFDs () (int32 , error )
NumFDs returns the number of File Descriptors used by the process.
(*Process) NumFDsWithContext (ctx context .Context ) (int32 , error )
(*Process) NumThreads () (int32 , error )
NumThreads returns the number of threads used by the process.
(*Process) NumThreadsWithContext (ctx context .Context ) (int32 , error )
(*Process) OpenFiles () ([]OpenFilesStat , error )
OpenFiles returns a slice of OpenFilesStat opend by the process.
OpenFilesStat includes a file path and file descriptor.
(*Process) OpenFilesWithContext (ctx context .Context ) ([]OpenFilesStat , error )
(*Process) PageFaults () (*PageFaultsStat , error )
PageFaultsInfo returns the process's page fault counters
(*Process) PageFaultsWithContext (ctx context .Context ) (*PageFaultsStat , error )
(*Process) Parent () (*Process , error )
Parent returns parent Process of the process.
(*Process) ParentWithContext (ctx context .Context ) (*Process , error )
(*Process) Percent (interval time .Duration ) (float64 , error )
If interval is 0, return difference from last call(non-blocking).
If interval > 0, wait interval sec and return diffrence between start and end.
(*Process) PercentWithContext (ctx context .Context , interval time .Duration ) (float64 , error )
(*Process) Ppid () (int32 , error )
Ppid returns Parent Process ID of the process.
(*Process) PpidWithContext (ctx context .Context ) (int32 , error )
(*Process) Resume () error
Resume sends SIGCONT to the process.
(*Process) ResumeWithContext (ctx context .Context ) error
(*Process) Rlimit () ([]RlimitStat , error )
Rlimit returns Resource Limits.
(*Process) RlimitUsage (gatherUsed bool ) ([]RlimitStat , error )
RlimitUsage returns Resource Limits.
If gatherUsed is true, the currently used value will be gathered and added
to the resulting RlimitStat.
(*Process) RlimitUsageWithContext (ctx context .Context , gatherUsed bool ) ([]RlimitStat , error )
(*Process) RlimitWithContext (ctx context .Context ) ([]RlimitStat , error )
(*Process) SendSignal (sig syscall .Signal ) error
SendSignal sends a unix.Signal to the process.
Currently, SIGSTOP, SIGCONT, SIGTERM and SIGKILL are supported.
(*Process) SendSignalWithContext (ctx context .Context , sig syscall .Signal ) error
(*Process) Status () (string , error )
Status returns the process status.
Return value could be one of these.
R: Running S: Sleep T: Stop I: Idle
Z: Zombie W: Wait L: Lock
The character is same within all supported platforms.
(*Process) StatusWithContext (ctx context .Context ) (string , error )
( Process) String () string
(*Process) Suspend () error
Suspend sends SIGSTOP to the process.
(*Process) SuspendWithContext (ctx context .Context ) error
(*Process) Terminal () (string , error )
Terminal returns a terminal which is associated with the process.
(*Process) TerminalWithContext (ctx context .Context ) (string , error )
(*Process) Terminate () error
Terminate sends SIGTERM to the process.
(*Process) TerminateWithContext (ctx context .Context ) error
(*Process) Tgid () (int32 , error )
Tgid returns tgid, a Linux-synonym for user-space Pid
(*Process) Threads () (map[int32 ]*cpu .TimesStat , error )
(*Process) ThreadsWithContext (ctx context .Context ) (map[int32 ]*cpu .TimesStat , error )
(*Process) Times () (*cpu .TimesStat , error )
Times returns CPU times of the process.
(*Process) TimesWithContext (ctx context .Context ) (*cpu .TimesStat , error )
(*Process) Uids () ([]int32 , error )
Uids returns user ids of the process as a slice of the int
(*Process) UidsWithContext (ctx context .Context ) ([]int32 , error )
(*Process) Username () (string , error )
Username returns a username of the process.
(*Process) UsernameWithContext (ctx context .Context ) (string , error )
Implements (at least 2 )
Process : github.com/ChrisTrenkamp/goxpath/tree.Result
Process : fmt.Stringer
As Outputs Of (at least 7 )
func NewProcess (pid int32 ) (*Process , error )
func Processes () ([]*Process , error )
func ProcessesWithContext (ctx context .Context ) ([]*Process , error )
func (*Process).Children () ([]*Process , error )
func (*Process).ChildrenWithContext (ctx context .Context ) ([]*Process , error )
func (*Process).Parent () (*Process , error )
func (*Process).ParentWithContext (ctx context .Context ) (*Process , error )
Package-Level Functions (total 7)
Package-Level Variables (total 3)
Package-Level Constants (total 18)
const ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK)
The pages are generated with Golds v0.6.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .