Documentation ¶
Index ¶
Constants ¶
View Source
const ( Name = "cpu" Description = "Tracks the CPU usage combined all the CPUs (not per-CPU)." )
View Source
const ( StateNameInfo = "info" StateKeyInfoCPU = "cpu" StateKeyInfoArch = "arch" StateKeyInfoFamily = "family" StateKeyInfoModel = "model" StateKeyInfoModelName = "model_name" StateNameCores = "cores" StateKeyCoresPhysical = "physical" StateKeyCoresLogical = "logical" StateNameUsage = "usage" StateKeyUsageUsedPercent = "used_percent" StateKeyUsageLoadAvg1Min = "load_avg_1min" StateKeyUsageLoadAvg5Min = "load_avg_5min" StateKeyUsageLoadAvg15Min = "load_avg_15min" )
Variables ¶
View Source
var Tags = []string{"cpu"}
Functions ¶
Types ¶
type Config ¶
type Config struct {
Query query_config.Config `json:"query"`
}
type Info ¶
type Output ¶
type Output struct { Info Info `json:"info"` Cores Cores `json:"cores"` Usage Usage `json:"usage"` }
func ParseOutputJSON ¶
func ParseStatesToOutput ¶
func ParseStatesToOutput(states ...components.State) (*Output, error)
type Usage ¶
type Usage struct { // Used CPU in percentage. UsedPercent string `json:"used_percent"` // Load average for the last 1-minute, with the scale of 1.00. LoadAvg1Min string `json:"load_avg_1min"` // Load average for the last 5-minutes, with the scale of 1.00. LoadAvg5Min string `json:"load_avg_5min"` // Load average for the last 15-minutes, with the scale of 1.00. LoadAvg15Min string `json:"load_avg_15min"` }
func (Usage) GetLoadAvg15Min ¶
func (Usage) GetLoadAvg1Min ¶
func (Usage) GetLoadAvg5Min ¶
func (Usage) GetUsedPercent ¶
Click to show internal directories.
Click to hide internal directories.