nodeinfocollect

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

package nodeinfocollect has all the methods for collecting the information for nodeinfo

package nodeinfocollect has all the methods for collecting the information for nodeinfo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateDiskUsage added in v0.6.0

func CalculateDiskUsage(directory string) (int64, error)

func CollectSystemMetrics added in v0.6.0

func CollectSystemMetrics(params CollectionParams, sleeper func(time.Duration), metrics metrics.Collector) error

func GetDiskUsageAllFromPartitions added in v0.6.0

func GetDiskUsageAllFromPartitions(partitions []disk.PartitionStat) (string, error)

func HumanReadableSize added in v0.6.0

func HumanReadableSize(size uint64) string

HumanReadableSize is matching df -h output which tends to be base 2 and not base 10 this will create a disconnect between the vendor disk sizes and what this reports

func RunCollectDiskUsage added in v0.6.0

func RunCollectDiskUsage(c *conf.CollectConf) error

func RunCollectDiskUsageFromPartitionList added in v0.6.0

func RunCollectDiskUsageFromPartitionList(c *conf.CollectConf, partitions []disk.PartitionStat) error

RunCollectDiskUsaget collects disk usage information and writes it to files. It takes a pointer to a CollectConf struct (c) It returns an error if any operation fails.

func SystemMetrics

func SystemMetrics(args Args) error

Types

type Args added in v0.6.0

type Args struct {
	IntervalSeconds int
	DurationSeconds int
	OutFile         string
}

type CollectionParams added in v0.6.0

type CollectionParams struct {
	IntervalSeconds int
	DurationSeconds int
	RowWriter       func(SystemMetricsRow) error
}

CollectionParams includes all the necessary parameters to complete a collection

type SystemMetricsRow

type SystemMetricsRow struct {
	CollectionTimeStamp time.Time `json:"collectionTimestamp"`
	UserCPUPercent      float64   `json:"userCPUPercent"`
	SystemCPUPercent    float64   `json:"systmeCPUPercent"`
	IdleCPUPercent      float64   `json:"idleCPUPercent"`
	NiceCPUPercent      float64   `json:"niceCPUPercent"`
	IOWaitCPUPercent    float64   `json:"ioWaitCPUPercent"`
	IRQCPUPercent       float64   `json:"irqCPUPercent"`
	SoftIRQCPUPercent   float64   `json:"softIRQCPUPercent"`
	StealCPUPercent     float64   `json:"stealCPUPercent"`
	GuestCPUPercent     float64   `json:"guestCPUPercent"`
	GuestNiceCPUPercent float64   `json:"guestCPUNicePercent"`
	QueueDepth          float64   `json:"queueDepth"`
	DiskLatency         float64   `json:"diskLatency"`
	ReadBytes           int64     `json:"readBytes"`
	WriteBytes          int64     `json:"writeBytes"`
	FreeRAMMB           int64     `json:"freeRAMMB"`
	CachedRAMMB         int64     `json:"cachedRAMMB"`
}

SystemMetricsRow represents a row of system metrics data.

Directories

Path Synopsis
gopsmetrics implements metrics collection using gopsutil
gopsmetrics implements metrics collection using gopsutil
metrics provides the interface to implement metrics
metrics provides the interface to implement metrics

Jump to

Keyboard shortcuts

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