stats

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesPoolStats added in v0.10.4

func BytesPoolStats(topN int, ps ...*bytespool.CapacityPools) map[string]any

func MainStats added in v0.7.1

func MainStats() map[string]any

MainStats 主程序系统指标. MemoryInfo 失败时省略 MemRSS/MemVMS/MemSwap, 其余字段仍返回; 进程句柄不可用时返回 nil. 连接和文件描述符枚举最多每30秒执行一次, 以避免每个 stats 请求重复读取内核表.

func MetricStats added in v0.7.1

func MetricStats() map[string]any

MetricStats 主程序运行指标

func MetricStatsDesc added in v0.10.0

func MetricStatsDesc() map[string]any

MetricStatsDesc 主程序运行指标注释

func MetricStatsWithBytesPoolStats added in v1.0.3

func MetricStatsWithBytesPoolStats(topN int, ps ...*bytespool.CapacityPools) map[string]any

MetricStatsWithBytesPoolStats 带内存池统计指标

func NetworkStats added in v1.3.9

func NetworkStats() map[string]any

NetworkStats 返回主机网络命名空间的累计计数. 函数是可选入口, 只在调用且缓存过期时读取系统计数, 不启动后台任务; 返回值不代表当前进程独占流量, 调用方应使用 CollectedAt 做相邻差分.

func NetworkStatsDesc added in v1.3.9

func NetworkStatsDesc() map[string]any

NetworkStatsDesc 网络资源累计指标注释.

func RedisDBSize added in v0.9.3

func RedisDBSize() int

RedisDBSize 当前数据库键数量

func RedisInfo added in v0.9.3

func RedisInfo() map[string]any

RedisInfo Redis 运行状态信息. 未初始化返回 nil; INFO 中空行、注释和无冒号行会被跳过, 不因此 panic.

func RedisStats added in v0.9.3

func RedisStats() map[string]any

RedisStats Redis 连接池统计信息

func SYSStats

func SYSStats() map[string]any

SYSStats 系统信息. 主机动态资源最多每30秒读取一次, 其余应用和时间字段仍实时生成.

func SYSStatsDesc added in v0.10.0

func SYSStatsDesc() map[string]any

SYSStatsDesc 系统信息指标注释

func WebStats added in v0.0.16

func WebStats() map[string]any

func WebStatsDesc added in v0.10.0

func WebStatsDesc() map[string]string

WebStatsDesc Web服务指标注释

Types

This section is empty.

Jump to

Keyboard shortcuts

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