metrics

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Snapshot

type Snapshot struct {
	Timestamp     time.Time     `json:"timestamp"`
	Uptime        time.Duration `json:"uptime"`
	MemoryTotal   uint64        `json:"memory_total"`
	MemoryUsed    uint64        `json:"memory_used"`
	MemoryPercent float64       `json:"memory_percent"`
	CPUPercent    float64       `json:"cpu_percent"`
	DiskTotal     uint64        `json:"disk_total"`
	DiskUsed      uint64        `json:"disk_used"`
	DiskPercent   float64       `json:"disk_percent"`
}

Snapshot represents a moment-in-time capture of system state

func Gather

func Gather() (*Snapshot, error)

gather collects current system metrics and returns a snapshot

func SnapshotFromJSON added in v0.0.2

func SnapshotFromJSON(data string) (*Snapshot, error)

SnapshotFromJSON deserializes a snapshot from a JSON string

func (*Snapshot) ToJSON added in v0.0.2

func (s *Snapshot) ToJSON() (string, error)

ToJSON serializes the snapshot to a JSON string

Jump to

Keyboard shortcuts

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