sysstat

package
v0.0.0-...-7b3ddb2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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 DiskCap

type DiskCap struct {
	DiskTotal *metric.Gauge
	DiskUsed  *metric.Gauge
	DiskFree  *metric.Gauge
}

type RuntimeStatOption

type RuntimeStatOption struct {
	Ctx        context.Context
	HeapSample bool
	Interval   time.Duration
	DiskPath   []string
	DiskQuota  uint64
}

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()

Jump to

Keyboard shortcuts

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