recovery

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogCrash

func LogCrash(r interface{})

LogCrash write down the current memory and stack info and the cpu/mem/disk infos into log dir

func Recover

func Recover()

Recover catchs the crashing goroutine

func SetCrashlogDir

func SetCrashlogDir(dir string) error

SetCrashlogDir set the directory of crashlog

Types

type CPUInfo

type CPUInfo struct {
	PhysicalCount int             `json:"physical_count"`
	LogicalCount  int             `json:"logical_count"`
	TotalPercent  []float64       `json:"total_use_percent"`
	PerPercent    []float64       `json:"per_use_percent"`
	Loads         *load.AvgStat   `json:"average_loads"`
	Times         []cpu.TimesStat `json:"running_times"`
	Infos         []cpu.InfoStat  `json:"infos"`
}

CPUInfo stat cpu infos

type DiskInfo

type DiskInfo struct {
	IOCounters map[string]disk.IOCountersStat `json:"io_counters"`
	Partitions []disk.PartitionStat           `json:"partitions"`
}

DiskInfo stat disk infos

type MemInfo

type MemInfo struct {
	Virtual *mem.VirtualMemoryStat `json:"virtaul"`
	Swap    *mem.SwapMemoryStat    `json:"swap"`
}

MemInfo stat memory infos

Jump to

Keyboard shortcuts

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