stat

package
v0.0.0-...-304f10d Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	// 进程级cpu
	CpuUsage             int64   // 当前
	PrevCpuUsage1        int64   // 250ms
	PrevCpuUsage2        int64   // 500ms
	CpuUsageStdDeviation float64 // cpu标准差

	// 进程级别内存
	MemUsage      int64
	PrevMemUsage1 int64
	PrevMemUsage2 int64

	// 运行时级别
	CpuNum       int    // 可用逻辑cpu核心数
	GoroutineNum int    // 当前协程数
	Alloc        uint64 // 当前分配对象所占的内存大小
	TotalAlloc   uint64 // 累计拿来进行对象分配的内存字节大小
	Sys          uint64 // 从操作系统申请到虚拟内存大小
	NumGC        uint32 // 已经完成的GC次数
	HeapInuse    uint64 // 使用中的堆大小
	HeapIdle     uint64 // 空闲的堆大小
	HeapAlloc    uint64 // 当前分配对象所占的内存大小
	HeapSys      uint64 // 从操作系统申请到堆虚拟内存大小
	HeapReleased uint64 // 释放返回给操作系统的堆的大小
}

type Stat

type Stat struct {
	Registry *prometheus.Registry
	Metrics  Metrics
	// contains filtered or unexported fields
}

func New

func New() *Stat

func (*Stat) MonitorGoRuntime

func (stat *Stat) MonitorGoRuntime()

func (*Stat) MonitorProcess

func (stat *Stat) MonitorProcess()

MonitorProcess 监控进程信息

Jump to

Keyboard shortcuts

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