|
|
|
@ -335,7 +335,7 @@ func (p *Process) MemoryPercentWithContext(ctx context.Context) (float32, error)
|
|
|
|
|
return (100 * float32(used) / float32(total)), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CPU_Percent returns how many percent of the CPU time this process uses
|
|
|
|
|
// CPUPercent returns how many percent of the CPU time this process uses
|
|
|
|
|
func (p *Process) CPUPercent() (float64, error) {
|
|
|
|
|
return p.CPUPercentWithContext(context.Background())
|
|
|
|
|
}
|
|
|
|
@ -507,7 +507,7 @@ func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) {
|
|
|
|
|
return p.MemoryInfoExWithContext(context.Background())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PageFaultsInfo returns the process's page fault counters.
|
|
|
|
|
// PageFaults returns the process's page fault counters.
|
|
|
|
|
func (p *Process) PageFaults() (*PageFaultsStat, error) {
|
|
|
|
|
return p.PageFaultsWithContext(context.Background())
|
|
|
|
|
}
|
|
|
|
@ -530,7 +530,7 @@ func (p *Process) Connections() ([]net.ConnectionStat, error) {
|
|
|
|
|
return p.ConnectionsWithContext(context.Background())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Connections returns a slice of net.ConnectionStat used by the process at most `max`.
|
|
|
|
|
// ConnectionsMax returns a slice of net.ConnectionStat used by the process at most `max`.
|
|
|
|
|
func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) {
|
|
|
|
|
return p.ConnectionsMaxWithContext(context.Background(), max)
|
|
|
|
|
}
|
|
|
|
|