disk

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package disk tracks the disk usage of all the mount points specified in the configuration.

Index

Constants

View Source
const (
	StateNameDiskExtPartition  = "disk_ext_partition"
	StateNameDiskBlockDevices  = "disk_block_devices"
	StateNameMountTargetUsages = "mount_target_usages"

	StateKeyData           = "data"
	StateKeyEncoding       = "encoding"
	StateValueEncodingJSON = "json"

	StateNameDiskBlockDevicesTotal         = "disk_block_devices_total"
	StateKeyDiskBlockDevicesTotalBytes     = "disk_block_devices_total_bytes"
	StateKeyDiskBlockDevicesTotalGB        = "disk_block_devices_total_gb"
	StateKeyDiskBlockDevicesTotalHumanized = "disk_block_devices_total_humanized"

	StateNameDiskExtPartitionsTotal         = "disk_ext_partitions_total"
	StateKeyDiskExtPartitionsTotalBytes     = "disk_ext_partitions_total_bytes"
	StateKeyDiskExtPartitionsTotalGB        = "disk_ext_partitions_total_gb"
	StateKeyDiskExtPartitionsTotalHumanized = "disk_ext_partitions_total_humanized"
)

Variables

This section is empty.

Functions

func CreateGet

func CreateGet(cfg Config) query.GetFunc

func New

Types

type Config

type Config struct {
	Query query_config.Config `json:"query"`

	// Specifies the mount points to track the disk usage for (e.g., metrics).
	MountPointsToTrackUsage []string `json:"mount_points_to_track_usage"`

	// Mount targets to track the disk usage for (e.g., /var/lib/kubelet).
	MountTargetsToTrackUsage []string `json:"mount_targets_to_track_usage"`
}

func DefaultConfig

func DefaultConfig() Config

func ParseConfig

func ParseConfig(b any, db *sql.DB) (*Config, error)

func (Config) Validate

func (cfg Config) Validate() error

type Output

type Output struct {
	DiskExtPartitions disk.Partitions               `json:"disk_ext_partitions"`
	DiskBlockDevices  disk.BlockDevices             `json:"disk_block_devices"`
	MountTargetUsages map[string]disk.FindMntOutput `json:"mount_target_usages"`
}

func (*Output) States

func (o *Output) States() ([]components.State, error)

Directories

Path Synopsis
Package id represents the disk component ID.
Package id represents the disk component ID.
Package metrics implements the disk metrics collection and reporting.
Package metrics implements the disk metrics collection and reporting.

Jump to

Keyboard shortcuts

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