sys

package
v2.8.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package sys provides system utilities for monitoring network connections and CPU usage. Platform-specific implementations are provided for Windows, Linux, and macOS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUPercentRaw

func CPUPercentRaw() (float64, error)

CPUPercentRaw returns the instantaneous total CPU utilization percentage using Windows GetSystemTimes across all logical processors. The first call returns 0 as it initializes the baseline. Subsequent calls compute deltas.

func GetConnectionCount

func GetConnectionCount(proto string) (int, error)

GetConnectionCount returns the number of active connections for the specified protocol ("tcp" or "udp").

func GetTCPCount

func GetTCPCount() (int, error)

GetTCPCount returns the number of active TCP connections.

func GetUDPCount

func GetUDPCount() (int, error)

GetUDPCount returns the number of active UDP connections.

func HostProc

func HostProc(combineWith ...string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL