recovery

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogCrash added in v1.8.1

func LogCrash(r interface{})

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

func Recover added in v1.8.1

func Recover()

Recover catchs the crashing goroutine

func SetCrashlogDir added in v1.8.1

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