Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintStats ¶
func PrintStats(logger *zap.SugaredLogger)
Types ¶
type MachineMemoryStats ¶
type MachineStats ¶
type MachineStats struct {
CpuUsagePercent float64 `json:"cpuUsagePercent"`
CpuUsagePercentError error `json:"cpuUsagePercentError,omitempty"`
DiskPath string `json:"diskPath,omitempty"`
DiskUsagePercent float64 `json:"diskUsagePercent,omitempty"`
DiskUsagePercentError error `json:"diskUsagePercentError,omitempty"`
// ProcessCount 进程数
ProcessCount int `json:"processCount,omitempty"`
ProcessCountError error `json:"processCountError,omitempty"`
// ProcessThreadCount 进程数(包括线程数)
ProcessThreadCount int `json:"processThreadCount,omitempty"`
ProcessThreadCountError error `json:"processThreadCountError,omitempty"`
MaxProcessThreadCountByUser int `json:"maxProcessThreadCountByUser,omitempty"`
MaxProcessThreadCountByUserError string `json:"maxProcessThreadCountByUserError,omitempty"`
PidMax int `json:"pidMax,omitempty"`
PidMaxError string `json:"pidMaxError,omitempty"`
ThreadsMax int `json:"threadsMax,omitempty"`
ThreadsMaxError string `json:"threadsMaxError,omitempty"`
MaxMapCount int `json:"maxMapCount,omitempty"`
MaxMapCountError string `json:"maxMapCountError,omitempty"`
Memory *MachineMemoryStats `json:"memory"`
}
type ProgramMemoryStats ¶
type ProgramMemoryStats struct {
// Alloc
/*
当前堆上分配的对象的字节数。这代表了程序正在使用的内存量。它会随着程序的运行动态变化,当分配新对象时增加,当垃圾回收回收对象时可能减少。
*/
Alloc string `json:"alloc"`
// TotalAlloc
/*
从程序开始到现在累计分配的堆内存字节数。即使某些内存已经被垃圾回收释放,这个值也不会减少。它反映了程序运行过程中的总内存分配情况,可以用来观察程序的内存增长趋势。
*/
TotalAlloc string `json:"totalAlloc"`
// Sys
/*
从操作系统获取的内存字节数。这包括所有已分配的堆内存、栈内存以及其他由 Go 运行时系统管理的内存。这个值通常大于Alloc,因为它还包括未被使用但已经从操作系统获取的内存。
*/
Sys string `json:"sys"`
NumGC uint32 `json:"numGC"`
EnableGC bool `json:"enableGC"`
}
type ProgramStats ¶
type ProgramStats struct {
PID int `json:"pid"`
GoroutineCount int `json:"goroutineCount"`
CpuUsagePercent float64 `json:"cpuUsagePercent"`
CpuUsagePercentError error `json:"cpuUsagePercentError,omitempty"`
Memory *ProgramMemoryStats `json:"memory"`
}
type Stats ¶
type Stats struct {
Program *ProgramStats `json:"program"`
Machine *MachineStats `json:"machine"`
}
Click to show internal directories.
Click to hide internal directories.