Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProcessCPUPercent = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "process_cpu_percent", Help: "How many percent of the cpu time process uses.", }, []string{"hostname", "pid", "pid_name", "ppid"}, ) ProcessMemoryPercent = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "process_memory_percent", Help: "How many percent of the memory process uses.", }, []string{"hostname", "pid", "pid_name", "ppid"}, ) ProcessMemoryRSS = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "process_memory_rss", Help: "How many rss of the memory process uses.", }, []string{"hostname", "pid", "pid_name", "ppid"}, ) ProcessRequestDuration = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Name: "process_request_duration_seconds", Help: "Process request duration in seconds.", Buckets: []float64{.01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10}, }, []string{"hostname", "pid", "pid_name", "ppid"}, ) ProcessPerRequestDuration = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "process_per_request_duration_seconds", Help: "Process per request duration in seconds.", }, []string{"hostname", "pid", "pid_name", "ppid", "trace_id"}, ) )
Functions ¶
Types ¶
type MemoryInfo ¶
type MemoryInfo struct {
MemoryPercent float32
*process.MemoryInfoStat
}
type ProcessInfo ¶
type ProcessInfo struct {
Pid int32
ParentPid int32
ProcessName string
CPUInfo *CPUInfo
MemoryInfo *MemoryInfo
}
func CollectProcessInfo ¶
func CollectProcessInfo(pid int32) (*ProcessInfo, error)
Click to show internal directories.
Click to hide internal directories.