Documentation
¶
Index ¶
- func NewConcurrency() *concurrency
- func NewHttpServerConnStats() *httpServerConnStats
- func UpdateCPUUsage(ctx context.Context) error
- type CPUMemory
- type ConnStats
- type ConnectionStat
- type ConnectionsCount
- type IOCountersStat
- type NumCtxSwitchesStat
- type NumFdsStat
- type OpenFilesStat
- type PageFaultsStat
- type Performance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHttpServerConnStats ¶
func NewHttpServerConnStats() *httpServerConnStats
NewHttpServerConnStats create a new http server conn stats
Types ¶
type CPUMemory ¶
type CPUMemory struct { GoMaxProcs int `json:"goMaxProcs"` ThreadCount int32 `json:"threadCount"` RoutineCount int `json:"routineCount"` CPUUser int `json:"cpuUser"` CPUSystem int `json:"cpuSystem"` CPUIdle int `json:"cpuIdle"` CPUNice int `json:"cpuNice"` CPUIowait int `json:"cpuIowait"` CPUIrq int `json:"cpuIrq"` CPUSoftirq int `json:"cpuSoftirq"` CPUSteal int `json:"cpuSteal"` CPUGuest int `json:"cpuGuest"` CPUGuestNice int `json:"cpuGuestNice"` CPUUsage int32 `json:"cpuUsage"` CPUBusy string `json:"cpuBusy"` MemAlloc int `json:"memAlloc"` MemTotalAlloc int `json:"memTotalAlloc"` MemSys int `json:"memSys"` MemLookups uint64 `json:"memLookups"` MemMallocs uint64 `json:"memMallocs"` MemFrees uint64 `json:"memFrees"` MemHeapAlloc int `json:"memHeapAlloc"` MemHeapSys int `json:"memHeapSys"` MemHeapIdle int `json:"memHeapIdle"` MemHeapInuse int `json:"memHeapInuse"` MemHeapReleased int `json:"memHeapReleased"` MemHeapObjects uint64 `json:"memHeapObjects"` MemStackInuse int `json:"memStackInuse"` MemStackSys int `json:"memStackSys"` MemMSpanInuse int `json:"memMSpanInuse"` MemMSpanSys int `json:"memMSpanSys"` MemMCacheInuse int `json:"memMCacheInuse"` MemMCacheSys int `json:"memMCacheSys"` MemBuckHashSys int `json:"memBuckHashSys"` MemGCSys int `json:"memGCSys"` MemOtherSys int `json:"memOtherSys"` LastGC time.Time `json:"lastGC"` NumGC uint32 `json:"numGC"` NumForcedGC uint32 `json:"numForcedGC"` RecentPause string `json:"recentPause"` RecentPauseNs time.Duration `json:"recentPauseNs"` PauseTotal string `json:"pauseTotal"` PauseTotalNs time.Duration `json:"pauseTotalNs"` PauseNs [256]uint64 `json:"pauseNs"` // 各指标收集耗时 // 内存指标 MemStatsTook time.Duration // 线程指标 ThreadCountStatsTook time.Duration // CPU使用 CPUTimeStatsTook time.Duration }
CPUMemory 应用CPU与Memory相关指标
func CurrentCPUMemory ¶
CurrentCPUMemory 获取当前应用性能指标
type ConnStats ¶
type ConnStats struct { ConnProcessing int32 `json:"connProcessing"` ConnProcessedCount int64 `json:"connProcessedCount"` ConnAlive int32 `json:"connAlive"` ConnCreatedCount int64 `json:"connCreatedCount"` }
ConnStats conn stats
type ConnectionStat ¶ added in v0.5.0
type ConnectionStat struct { Connections []pnet.ConnectionStat `json:"connections"` Took time.Duration `json:"took"` }
func Connections ¶ added in v0.3.0
func Connections(ctx context.Context) (*ConnectionStat, error)
Connections returns the connections stats
type ConnectionsCount ¶ added in v0.3.0
type ConnectionsCount struct { Status map[string]int `json:"status"` RemoteAddr map[string]int `json:"remoteAddr"` Count int `json:"count"` Took time.Duration `json:"took"` }
func ConnectionsStat ¶ added in v0.3.0
func ConnectionsStat(ctx context.Context) (*ConnectionsCount, error)
ConnectionsStat return the count of connections stats
type IOCountersStat ¶ added in v0.5.0
type IOCountersStat struct { process.IOCountersStat Took time.Duration `json:"took"` }
func IOCounters ¶ added in v0.3.0
func IOCounters(ctx context.Context) (*IOCountersStat, error)
IOCounters returns the conters stats info
type NumCtxSwitchesStat ¶ added in v0.5.0
type NumCtxSwitchesStat struct { process.NumCtxSwitchesStat Took time.Duration `json:"took"` }
func NumCtxSwitches ¶ added in v0.3.0
func NumCtxSwitches(ctx context.Context) (*NumCtxSwitchesStat, error)
NumCtxSwitches returns the switch stats of process
type NumFdsStat ¶ added in v0.5.0
type OpenFilesStat ¶ added in v0.5.0
type OpenFilesStat struct { OpenFiles []process.OpenFilesStat `json:"openFiles"` Took time.Duration `json:"took"` }
type PageFaultsStat ¶ added in v0.5.0
type PageFaultsStat struct { process.PageFaultsStat Took time.Duration `json:"took"` }
func PageFaults ¶ added in v0.3.0
func PageFaults(ctx context.Context) (*PageFaultsStat, error)
PageFaults returns page fault stats
type Performance ¶ added in v1.1.0
type Performance struct { CPUMemory IOCountersStat *IOCountersStat `json:"ioCountersStat"` ConnStat *ConnectionsCount `json:"connStat"` NumCtxSwitchesStat *NumCtxSwitchesStat `json:"numCtxSwitchesStat"` PageFaultsStat *PageFaultsStat `json:"pageFaultsStat"` NumFdsStat *NumFdsStat `json:"numFdsStat"` OpenFilesStats *OpenFilesStat `json:"openFilesStats"` }
func GetPerformance ¶ added in v1.1.0
func GetPerformance(ctx context.Context) *Performance
GetPerformance 获取应用性能指标
func (*Performance) ToMap ¶ added in v1.1.0
func (perf *Performance) ToMap(prevPerf *Performance) map[string]interface{}
Click to show internal directories.
Click to hide internal directories.