nodestore

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskIOState

type DiskIOState struct {
	DiskReadKiBps  float64 `structs:"diskio_read_kibps"`
	DiskWriteKiBps float64 `structs:"diskio_write_kibps"`
	DiskReadIOps   float64 `structs:"diskio_read_iops"`
	DiskWriteIOps  float64 `structs:"diskio_write_iops"`
	Util           float64 `structs:"diskio_util"`
}

DiskIOState record signal disk io state

func (*DiskIOState) GetTags

func (d *DiskIOState) GetTags() []string

GetTags get disk io resource tags

func (*DiskIOState) GetValue

func (d *DiskIOState) GetValue(resource, device string) (float64, error)

GetValue get disk io resource value

type IfaceStat

type IfaceStat struct {
	Iface string `structs:"iface"`
	// Speed is the total kilobits for the iface
	Speed int `structs:"netio_speed"`
	// NetRecvkbps is the kilobits per second for ingress
	NetRecvkbps float64 `structs:"netio_recv_kbps"`
	// NetSentkbps is the kilobits per second for egress
	NetSentkbps float64 `structs:"netio_sent_kbps"`
	// NetRecvPckps is the package per second for ingress
	NetRecvPckps float64 `structs:"netio_recv_pckps"`
	// NetSendPckps is the package per second for egress
	NetSentPckps float64 `structs:"netio_sent_pckps"`
	// NetDroIn is the package dropped per second for ingress
	NetDropIn float64 `structs:"netio_drop_in"`
	// NetDropOut is the package dropped per second for egress
	NetDropOut float64 `structs:"netio_drop_out"`
	// NetFifoIn is the number of in FIFO buffer errors
	NetFifoIn float64 `structs:"netio_fifo_in"`
	// NetFifoOut is the number of out FIFO buffer errors
	NetFifoOut float64 `structs:"netio_fifo_out"`
	// NetErrin is the number of errors while receiving
	NetErrin float64 `structs:"netio_err_in"`
	// NetErrout is the number of errors while receiving
	NetErrout float64 `structs:"netio_err_out"`
}

IfaceStat record signal network io stat

func (*IfaceStat) GetTags

func (is *IfaceStat) GetTags() []string

GetTags get network resource tags

func (*IfaceStat) GetValue

func (is *IfaceStat) GetValue(resource, device string) (float64, error)

GetValue get network io data by iface device

type NodeCpu

type NodeCpu struct {

	// core used per second
	CpuTotal   float64   `structs:"cpu_total"`
	CpuPerCore []float64 `structs:"cpu_per_core"`
	CpuAvg     float64   `structs:"cpu_avg"`

	CpuStealTotal   float64   `structs:"cpu_steal_total"`
	CpuStealPerCore []float64 `structs:"cpu_steal_per_core"`
	// contains filtered or unexported fields
}

NodeCpu record cpu state for node

func (*NodeCpu) GetTags

func (c *NodeCpu) GetTags() []string

GetTags get all node cpu resource tags

func (*NodeCpu) GetValue

func (c *NodeCpu) GetValue(resource, device string) (float64, error)

GetValue get node cpu resource value

type NodeDiskIO

type NodeDiskIO struct {

	// disk io
	IOState map[string]DiskIOState `structs:"diskio_state"`
	// contains filtered or unexported fields
}

NodeDiskIO record disk io state for node

func (*NodeDiskIO) GetValue

func (nd *NodeDiskIO) GetValue(resource, device string) (float64, error)

GetValue get disk io resource value by device name

type NodeLoad

type NodeLoad struct {
	Load1Min  float64 `structs:"load_1min"`
	Load5Min  float64 `structs:"load_5min"`
	Load15Min float64 `structs:"load_15min"`
}

NodeLoad record load state for node

func (*NodeLoad) GetTags

func (l *NodeLoad) GetTags() []string

GetTags get all node cpu load resource tags

func (*NodeLoad) GetValue

func (l *NodeLoad) GetValue(resource, device string) (float64, error)

GetValue get node cpu load resource value

type NodeMemory

type NodeMemory struct {
	Total      float64 `structs:"memory_total"`
	UsageTotal float64 `structs:"memory_usage_total"`
	UsageCache float64 `structs:"memory_usage_cache"`
	UsageRss   float64 `structs:"memory_usage_rss"`
	Available  float64 `structs:"memory_available"`
}

NodeMemory record memory state for node

func (*NodeMemory) GetTags

func (m *NodeMemory) GetTags() []string

GetTags get memory resource tags

func (*NodeMemory) GetValue

func (m *NodeMemory) GetValue(resource, device string) (float64, error)

GetValue get memory resource value

type NodeNetwork

type NodeNetwork struct {
	IfaceStats map[string]*IfaceStat `structs:"netio_stats"`
	// contains filtered or unexported fields
}

NodeNetwork record network io state for node

func (*NodeNetwork) GetValue

func (nn *NodeNetwork) GetValue(resource, device string) (float64, error)

GetValue get network io value by iface device

type NodeProcess

type NodeProcess struct {
	// Number of tasks in uninterruptible state
	NrUninterruptible uint64 `structs:"process_nr_uninterruptible"`
}

NodeProcess record processes status for node

func (*NodeProcess) GetTags

func (p *NodeProcess) GetTags() []string

GetTags get process resource tags

func (*NodeProcess) GetValue

func (p *NodeProcess) GetValue(resource, device string) (float64, error)

GetValue get process resource value

type NodeResourceState

type NodeResourceState struct {
	Timestamp time.Time    `structs:"timestamp,omitempty"`
	CPU       *NodeCpu     `structs:"cpu"`
	Load      *NodeLoad    `structs:"load"`
	Memory    *NodeMemory  `structs:"memory"`
	DiskIO    *NodeDiskIO  `structs:"diskio"`
	NetIO     *NodeNetwork `structs:"netio"`
	Process   *NodeProcess `structs:"process"`
}

NodeResourceState describe node resource

func (*NodeResourceState) GetTags

func (nrs *NodeResourceState) GetTags() []string

GetTags get all node resource tags

func (*NodeResourceState) GetValue

func (nrs *NodeResourceState) GetValue(resource, device string) (float64, error)

GetValue get node resource value

type NodeStore

type NodeStore interface {
	NodeStoreInterface
	Name() string
	Run(stop <-chan struct{})
}

NodeStore describe common interface for node resource inherit from state store

func NewNodeStoreManager

func NewNodeStoreManager(cacheAge time.Duration, config *types.MetricsNodeConfig,
	podInformer cache.SharedIndexInformer) NodeStore

NewNodeStoreManager new node resource state instance

type NodeStoreInterface

type NodeStoreInterface interface {
	GetNodeResourceRangeStats(start, end time.Time, count int) ([]*NodeResourceState, error)
	GetNodeResourceRecentState() (*NodeResourceState, error)
	GetNodeStoreSupportedTags() []string
}

NodeStoreInterface describe special interface for node resource

Jump to

Keyboard shortcuts

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