bcachefs

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package bcachefs provides access to statistics exposed by Bcachefs filesystems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BtreeWriteStats

type BtreeWriteStats struct {
	Count     uint64
	SizeBytes uint64
}

BtreeWriteStats contains btree write statistics for a specific type.

type CompressionStats

type CompressionStats struct {
	CompressedBytes        uint64
	UncompressedBytes      uint64
	AverageExtentSizeBytes uint64
}

CompressionStats contains compression statistics for a specific algorithm.

type CounterStats

type CounterStats struct {
	SinceMount              uint64
	SinceFilesystemCreation uint64
}

CounterStats contains counter values since mount and since filesystem creation.

type DeviceStats

type DeviceStats struct {
	Label           string
	State           string
	BucketSizeBytes uint64
	Buckets         uint64
	Durability      uint64
	IODone          map[string]map[string]uint64
	IOErrors        map[string]uint64
}

DeviceStats contains statistics for a Bcachefs device.

type ErrorStats

type ErrorStats struct {
	Count     uint64
	Timestamp uint64
}

ErrorStats contains error count and timestamp for a specific error type.

type FS

type FS struct {
	// contains filtered or unexported fields
}

FS represents the pseudo-filesystem sys, which provides an interface to kernel data structures.

func NewDefaultFS

func NewDefaultFS() (FS, error)

NewDefaultFS returns a new Bcachefs using the default sys fs mount point. It will error if the mount point can't be read.

func NewFS

func NewFS(mountPoint string) (FS, error)

NewFS returns a new Bcachefs filesystem using the given sys fs mount point. It will error if the mount point can't be read.

func (FS) Stats

func (fs FS) Stats() ([]*Stats, error)

Stats retrieves Bcachefs filesystem runtime statistics for each mounted Bcachefs filesystem.

type Stats

type Stats struct {
	UUID                string
	BtreeCacheSizeBytes uint64

	Compression map[string]CompressionStats
	Errors      map[string]ErrorStats
	Counters    map[string]CounterStats
	BtreeWrites map[string]BtreeWriteStats
	Devices     map[string]*DeviceStats
}

Stats contains statistics for a single Bcachefs filesystem.

func GetStats

func GetStats(uuidPath string) (*Stats, error)

GetStats collects all Bcachefs statistics from sysfs.

Jump to

Keyboard shortcuts

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