|
|
|
@ -545,6 +545,15 @@ func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionS
|
|
|
|
|
return net.ConnectionsPid("all", p.Pid)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Connections 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)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) {
|
|
|
|
|
return net.ConnectionsPidMax("all", p.Pid, max)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NetIOCounters returns NetIOCounters of the process.
|
|
|
|
|
func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) {
|
|
|
|
|
return p.NetIOCountersWithContext(context.Background(), pernic)
|
|
|
|
|