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: | */
ReadBytes uint64 ReadCount uint64 WriteBytes uint64 WriteCount uint64 ( IOCountersStat) String() string IOCountersStat : github.com/ChrisTrenkamp/goxpath/tree.Result IOCountersStat : fmt.Stringer func (*Process).IOCounters() (*IOCountersStat, error) func (*Process).IOCountersWithContext(ctx context.Context) (*IOCountersStat, error)
MemoryInfoExStat is different between OSes // bytes // bytes // bytes // bytes // bytes // bytes // bytes ( MemoryInfoExStat) String() string MemoryInfoExStat : github.com/ChrisTrenkamp/goxpath/tree.Result MemoryInfoExStat : fmt.Stringer func (*Process).MemoryInfoEx() (*MemoryInfoExStat, error) func (*Process).MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error)
// bytes // bytes // bytes // bytes // bytes // bytes // bytes ( MemoryInfoStat) String() string MemoryInfoStat : github.com/ChrisTrenkamp/goxpath/tree.Result MemoryInfoStat : fmt.Stringer func (*Process).MemoryInfo() (*MemoryInfoStat, error) func (*Process).MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error)
Anonymous uint64 Path string PrivateClean uint64 PrivateDirty uint64 Pss uint64 Referenced uint64 Rss uint64 SharedClean uint64 SharedDirty uint64 Size uint64 Swap uint64 String returns JSON value of the process. MemoryMapsStat : github.com/ChrisTrenkamp/goxpath/tree.Result MemoryMapsStat : fmt.Stringer func (*Process).MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) func (*Process).MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error)
Involuntary int64 Voluntary int64 ( NumCtxSwitchesStat) String() string NumCtxSwitchesStat : github.com/ChrisTrenkamp/goxpath/tree.Result NumCtxSwitchesStat : fmt.Stringer func (*Process).NumCtxSwitches() (*NumCtxSwitchesStat, error) func (*Process).NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error)
Fd uint64 Path string ( OpenFilesStat) String() string OpenFilesStat : github.com/ChrisTrenkamp/goxpath/tree.Result OpenFilesStat : fmt.Stringer func (*Process).OpenFiles() ([]OpenFilesStat, error) func (*Process).OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error)
ChildMajorFaults uint64 ChildMinorFaults uint64 MajorFaults uint64 MinorFaults uint64 func (*Process).PageFaults() (*PageFaultsStat, error) func (*Process).PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error)
Pid int32 Background returns true if the process is in background, false otherwise. (*Process) BackgroundWithContext(ctx context.Context) (bool, error) CPUAffinity returns CPU affinity of the process. Notice: Not implemented yet. (*Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) CPU_Percent returns how many percent of the CPU time this process uses (*Process) CPUPercentWithContext(ctx context.Context) (float64, error) Children returns a slice of Process of the process. (*Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) Cmdline returns the command line arguments of the process as a string with each argument separated by 0x20 ascii character. 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) Connections returns a slice of net.ConnectionStat used by the process. This returns all kind of the connection. This measn TCP, UDP or UNIX. 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) CreateTime returns created time of the process in milliseconds since the epoch, in UTC. (*Process) CreateTimeWithContext(ctx context.Context) (int64, error) Cwd returns current working directory of the process. (*Process) CwdWithContext(ctx context.Context) (string, error) Exe returns executable path of the process. (*Process) ExeWithContext(ctx context.Context) (string, error) Foreground returns true if the process is in foreground, false otherwise. (*Process) ForegroundWithContext(ctx context.Context) (bool, error) Gids returns group ids of the process as a slice of the int (*Process) GidsWithContext(ctx context.Context) ([]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) IOCounters returns IO Counters. (*Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) IOnice returns process I/O nice value (priority). (*Process) IOniceWithContext(ctx context.Context) (int32, error) IsRunning returns whether the process is still running or not. (*Process) IsRunningWithContext(ctx context.Context) (bool, error) Kill sends SIGKILL to the process. (*Process) KillWithContext(ctx context.Context) error MemoryInfo returns platform in-dependend memory information, such as RSS, VMS and Swap MemoryInfoEx returns platform dependend memory information. (*Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) (*Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) MemoryMaps get memory maps from /proc/(pid)/smaps (*Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) MemoryPercent returns how many percent of the total RAM this process uses (*Process) MemoryPercentWithContext(ctx context.Context) (float32, error) Name returns name of the process. (*Process) NameWithContext(ctx context.Context) (string, error) NetIOCounters returns NetIOCounters of the process. (*Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) Nice returns a nice value (priority). Notice: gopsutil can not set nice value. (*Process) NiceWithContext(ctx context.Context) (int32, error) NumCtxSwitches returns the number of the context switches of the process. (*Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) NumFDs returns the number of File Descriptors used by the process. (*Process) NumFDsWithContext(ctx context.Context) (int32, error) NumThreads returns the number of threads used by the process. (*Process) NumThreadsWithContext(ctx context.Context) (int32, 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) PageFaultsInfo returns the process's page fault counters (*Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) Parent returns parent Process of the process. (*Process) ParentWithContext(ctx context.Context) (*Process, 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) Ppid returns Parent Process ID of the process. (*Process) PpidWithContext(ctx context.Context) (int32, error) Resume sends SIGCONT to the process. (*Process) ResumeWithContext(ctx context.Context) error Rlimit returns Resource Limits. 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) 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 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 Suspend sends SIGSTOP to the process. (*Process) SuspendWithContext(ctx context.Context) error Terminal returns a terminal which is associated with the process. (*Process) TerminalWithContext(ctx context.Context) (string, error) Terminate sends SIGTERM to the process. (*Process) TerminateWithContext(ctx context.Context) 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) Times returns CPU times of the process. (*Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) Uids returns user ids of the process as a slice of the int (*Process) UidsWithContext(ctx context.Context) ([]int32, error) Username returns a username of the process. (*Process) UsernameWithContext(ctx context.Context) (string, error) Process : github.com/ChrisTrenkamp/goxpath/tree.Result Process : fmt.Stringer 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)
// TODO too small. needs to be uint64 Resource int32 // TODO too small. needs to be uint64 Used uint64 ( RlimitStat) String() string RlimitStat : github.com/ChrisTrenkamp/goxpath/tree.Result RlimitStat : fmt.Stringer func (*Process).Rlimit() ([]RlimitStat, error) func (*Process).RlimitUsage(gatherUsed bool) ([]RlimitStat, error) func (*Process).RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) func (*Process).RlimitWithContext(ctx context.Context) ([]RlimitStat, error)
Package-Level Functions (total 7)
NewProcess creates a new Process instance, it only stores the pid and checks that the process exists. Other method on Process can be used to get more information about the process. An error will be returned if the process does not exist.
func PidExists(pid int32) (bool, error)
Pids returns a slice of process ID list which are running now.
Process returns a slice of pointers to Process structs for all currently running processes.
Package-Level Variables (total 3)
Package-Level Constants (total 18)
const ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK)
const PrioProcess = 0 // linux/resource.h
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10
Resource limit constants are from /usr/include/x86_64-linux-gnu/bits/resource.h from libc6-dev package in Ubuntu 16.10