Documentation
¶
Overview ¶
Package psutil provides debug endpoints and profiling helpers for go-service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(cont *content.Content) http.HandlerFunc
NewHandler builds the HTTP handler that returns a psutil snapshot.
Types ¶
type CPU ¶
type CPU struct {
// Info contains static CPU information (model, cores, cache sizes, etc.).
Info []cpu.InfoStat `yaml:"info,omitempty" json:"info,omitempty" toml:"info,omitempty"`
// Times contains per-CPU time statistics (user/system/idle/etc.).
Times []cpu.TimesStat `yaml:"times,omitempty" json:"times,omitempty" toml:"times,omitempty"`
}
CPU contains CPU details collected for the debug endpoint.
type Host ¶
type Host struct {
// Info contains host information (OS, platform, uptime, etc.).
Info *host.InfoStat `yaml:"info,omitempty" json:"info,omitempty" toml:"info,omitempty"`
}
Host contains host/system details collected for the debug endpoint.
type Load ¶
type Load struct {
// Avg contains load averages (for example 1m/5m/15m).
Avg *load.AvgStat `yaml:"avg,omitempty" json:"avg,omitempty" toml:"avg,omitempty"`
}
Load contains system load details collected for the debug endpoint.
type Mem ¶
type Mem struct {
// Swap contains overall swap memory statistics.
Swap *mem.SwapMemoryStat `yaml:"swap,omitempty" json:"swap,omitempty" toml:"swap,omitempty"`
// Virtual contains virtual memory statistics.
Virtual *mem.VirtualMemoryStat `yaml:"virtual,omitempty" json:"virtual,omitempty" toml:"virtual,omitempty"`
// Devices contains per-device swap usage information.
Devices []*mem.SwapDevice `yaml:"devices,omitempty" json:"devices,omitempty" toml:"devices,omitempty"`
}
Mem contains memory details collected for the debug endpoint.
type Net ¶
type Net struct {
// Counters contains per-interface network I/O counters.
Counters []net.IOCountersStat `yaml:"counters,omitempty" json:"counters,omitempty" toml:"counters,omitempty"`
}
Net contains network details collected for the debug endpoint.
type Response ¶
type Response struct {
// CPU contains CPU information and times.
CPU *CPU `yaml:"cpu,omitempty" json:"cpu,omitempty" toml:"cpu,omitempty"`
// Host contains host/system information.
Host *Host `yaml:"host,omitempty" json:"host,omitempty" toml:"host,omitempty"`
// Load contains system load averages.
Load *Load `yaml:"load,omitempty" json:"load,omitempty" toml:"load,omitempty"`
// Mem contains memory and swap statistics.
Mem *Mem `yaml:"mem,omitempty" json:"mem,omitempty" toml:"mem,omitempty"`
// Net contains network I/O counters.
Net *Net `yaml:"net,omitempty" json:"net,omitempty" toml:"net,omitempty"`
}
Response is the response body returned by the psutil debug endpoint.
Click to show internal directories.
Click to hide internal directories.