Documentation
¶
Index ¶
- Constants
- type DiskCap
- type RuntimeStatOption
- type RuntimeStatSampler
- func (s *RuntimeStatSampler) CpuSample()
- func (s *RuntimeStatSampler) DiskSample()
- func (s *RuntimeStatSampler) MemorySample() error
- func (s *RuntimeStatSampler) NetSample()
- func (s *RuntimeStatSampler) Start() error
- func (s *RuntimeStatSampler) SwapSample()
- func (s *RuntimeStatSampler) UpdateTime()
Constants ¶
View Source
const ( CgoCallsMetric = "sys_cgocalls" GoroutinesMetric = "sys_goroutines" GCCountMetric = "sys_gc_count" GCCountPercentMetric = "sys_gc_count_percent" GCPauseNSMetric = "sys_gc_pause_ns" GCPausePercentMetric = "sys_gc_pause_percent" MemTotalMetric = "sys_mem_total" MemUsedMetric = "sys_mem_used" MemFreeMetric = "sys_mem_free" MemRSSMetric = "sys_mem_rss" MemUsedPercentMetric = "sys_mem_used_percent" GoAllocBytesMetric = "sys_go_allocbytes" GoTotalBytesMetric = "sys_go_totalbytes" SwapTotalMetric = "sys_swap_total" SwapUsedMetric = "sys_swap_used" SwapFreeMetric = "sys_swap_free" SwapUsedPercentMetric = "sys_swap_used_percent" CPUTotalMetric = "sys_cpu_total" CPUUserPercentMetric = "sys_cpu_user_percent" CPUSysPercentMetric = "sys_cpu_sys_percent" CPUIowaitPercentMetric = "sys_cpu_iowait_percent" CPUIdlePercentMetric = "sys_cpu_idle_percent" DiskTotalMetric = "sys_disk_total" DiskUsedMetric = "sys_disk_used" DiskFreeMetric = "sys_disk_free" FDOpenMetric = "sys_fd_open" NetInPerSecMetric = "sys_net_in_s" NetOutPerSecMetric = "sys_net_out_s" NetConnectMetric = "sys_net_connect" UptimeMetric = "sys_uptime" BuildTimeMetric = "build_timestamp" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RuntimeStatOption ¶
type RuntimeStatSampler ¶
type RuntimeStatSampler struct {
RuntimeStatOption
// GC Metric
CgoCalls *metric.Gauge
Goroutines *metric.Gauge
GcCount *metric.Gauge
GCCountPercent *metric.GaugeFloat64
GcPauseNS *metric.Gauge
GcPausePercent *metric.GaugeFloat64
// Memory Metric
MemTotal *metric.Gauge
MemUsed *metric.Gauge
MemFree *metric.Gauge
MemRss *metric.Gauge
MemUsedPercent *metric.GaugeFloat64
GoAllocBytes *metric.Gauge
GoTotalBytes *metric.Gauge
// Swap Metric
SwapTotal *metric.Gauge
SwapUsed *metric.Gauge
SwapFree *metric.Gauge
SwapUsedPercent *metric.GaugeFloat64
// CPU Metric
CPUTotal *metric.Gauge
CPUUserPercent *metric.GaugeFloat64
CPUSysPercent *metric.GaugeFloat64
CPUIowaitPercent *metric.GaugeFloat64
CPUIdlePercent *metric.GaugeFloat64
// Disk Metric
DiskUsage DiskCap
FDOpen *metric.Gauge
// Net Metric
NetInPerSec *metric.Gauge
NetOutPerSec *metric.Gauge
NetConnect *metric.Gauge
// Run Time
Uptime *metric.Gauge
BuildTimestamp *metric.Gauge
// contains filtered or unexported fields
}
RuntimeStatSampler is used to periodically sample the runtime environment for useful statistics.
func NewRuntimeStatSampler ¶
func NewRuntimeStatSampler(option RuntimeStatOption) *RuntimeStatSampler
NewRuntimeStatSampler create a RuntimeStatSampler object.
func (*RuntimeStatSampler) CpuSample ¶
func (s *RuntimeStatSampler) CpuSample()
func (*RuntimeStatSampler) DiskSample ¶
func (s *RuntimeStatSampler) DiskSample()
func (*RuntimeStatSampler) MemorySample ¶
func (s *RuntimeStatSampler) MemorySample() error
func (*RuntimeStatSampler) NetSample ¶
func (s *RuntimeStatSampler) NetSample()
func (*RuntimeStatSampler) Start ¶
func (s *RuntimeStatSampler) Start() error
StartSample queries the runtime system for various interesting metrics, storing the resulting values in the set of metric gauges .
func (*RuntimeStatSampler) SwapSample ¶
func (s *RuntimeStatSampler) SwapSample()
func (*RuntimeStatSampler) UpdateTime ¶
func (s *RuntimeStatSampler) UpdateTime()
Click to show internal directories.
Click to hide internal directories.