From 9aa4e7a744bb35916461100865e7774a76f4053c Mon Sep 17 00:00:00 2001 From: cui fliter Date: Tue, 9 May 2023 16:42:07 +0800 Subject: [PATCH] fix some comments Signed-off-by: cui fliter --- net/net_darwin.go | 2 +- net/net_freebsd.go | 2 +- net/net_linux.go | 2 +- net/net_openbsd.go | 2 +- net/net_windows.go | 2 +- process/process.go | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/net/net_darwin.go b/net/net_darwin.go index 1c8d4f4e3..4d2cfbcd8 100644 --- a/net/net_darwin.go +++ b/net/net_darwin.go @@ -278,7 +278,7 @@ func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackSta return nil, common.ErrNotImplementedError } -// NetProtoCounters returns network statistics for the entire system +// ProtoCounters returns network statistics for the entire system // If protocols is empty then all protocols are returned, otherwise // just the protocols in the list are returned. // Not Implemented for Darwin diff --git a/net/net_freebsd.go b/net/net_freebsd.go index 7f31851ea..bf8baf094 100644 --- a/net/net_freebsd.go +++ b/net/net_freebsd.go @@ -115,7 +115,7 @@ func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackSta return nil, common.ErrNotImplementedError } -// NetProtoCounters returns network statistics for the entire system +// ProtoCounters returns network statistics for the entire system // If protocols is empty then all protocols are returned, otherwise // just the protocols in the list are returned. // Not Implemented for FreeBSD diff --git a/net/net_linux.go b/net/net_linux.go index c7cd0db18..dd62d4791 100644 --- a/net/net_linux.go +++ b/net/net_linux.go @@ -157,7 +157,7 @@ var netProtocols = []string{ "udplite", } -// NetProtoCounters returns network statistics for the entire system +// ProtoCounters returns network statistics for the entire system // If protocols is empty then all protocols are returned, otherwise // just the protocols in the list are returned. // Available protocols: diff --git a/net/net_openbsd.go b/net/net_openbsd.go index 5f066a09f..cf48f53e7 100644 --- a/net/net_openbsd.go +++ b/net/net_openbsd.go @@ -164,7 +164,7 @@ func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackSta return nil, common.ErrNotImplementedError } -// NetProtoCounters returns network statistics for the entire system +// ProtoCounters returns network statistics for the entire system // If protocols is empty then all protocols are returned, otherwise // just the protocols in the list are returned. // Not Implemented for OpenBSD diff --git a/net/net_windows.go b/net/net_windows.go index 68b26bdcd..5d384342f 100644 --- a/net/net_windows.go +++ b/net/net_windows.go @@ -338,7 +338,7 @@ func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackSta return nil, common.ErrNotImplementedError } -// NetProtoCounters returns network statistics for the entire system +// ProtoCounters returns network statistics for the entire system // If protocols is empty then all protocols are returned, otherwise // just the protocols in the list are returned. // Not Implemented for Windows diff --git a/process/process.go b/process/process.go index 0ca26c210..1a7fe1b80 100644 --- a/process/process.go +++ b/process/process.go @@ -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) }