Versions in this module Expand all Collapse all v1 v1.2.1 Mar 27, 2026 v1.2.0 Mar 27, 2026 Changes in this version + const PrefixDefault + const PrefixGibi + const PrefixKibi + const PrefixMebi + const PrefixTebi + const UnlimitedMemory + var PrefixHumanGibi = "Gi" + var PrefixHumanKibi = "Ki" + var PrefixHumanMebi = "Mi" + var PrefixHumanTebi = "Ti" + type Option func(*Statter) + func WithCGroupV2Detector(detector func(fs afero.Fs) bool) Option + func WithFS(fs afero.Fs) Option + func WithLogger(logger slog.Logger) Option + func WithSampleInterval(d time.Duration) Option + type Prefix float64 + func ParsePrefix(s string) Prefix + func (s *Prefix) String() string + type Result struct + Prefix Prefix + Total *float64 + Unit string + Used float64 + func (r *Result) String() string + type Statter struct + func New(opts ...Option) (*Statter, error) + func (*Statter) Disk(p Prefix, path string) (*Result, error) + func (s *Statter) ContainerCPU() (*Result, error) + func (s *Statter) ContainerMemory(p Prefix) (*Result, error) + func (s *Statter) HostCPU() (*Result, error) + func (s *Statter) HostMemory(p Prefix) (*Result, error) + func (s *Statter) IsContainerized() (ok bool, err error)