perfmetrics

package
v2.15.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package perfmetrics captures coarse process and SQLite resource counters for long media operations. Snapshots are best-effort: missing /proc support or PRAGMA failures should never affect indexing or scraping behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDelta

func AddDelta(event *zerolog.Event, start, end *Snapshot) *zerolog.Event

Types

type DBProvider

type DBProvider interface {
	GetDBPath() string
	UnsafeGetSQLDb() *sql.DB
}

type DBStats

type DBStats struct {
	DBBytes               int64
	WALBytes              int64
	SHMBytes              int64
	PageCount             int64
	FreelistCount         int64
	PageSize              int64
	CacheSize             int64
	WALBusy               int64
	WALFrames             int64
	WALCheckpointedFrames int64
}

type ProcessIO

type ProcessIO struct {
	RChar               int64
	WChar               int64
	Syscr               int64
	Syscw               int64
	ReadBytes           int64
	WriteBytes          int64
	CancelledWriteBytes int64
}

type Recorder

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

func NewRecorder

func NewRecorder(dbPath string, sqlDB *sql.DB) Recorder

func NewRecorderForDB

func NewRecorderForDB(db DBProvider) (recorder Recorder)

func (Recorder) Capture

func (r Recorder) Capture(ctx context.Context, includeDB bool) Snapshot

type RuntimeStats

type RuntimeStats struct {
	AllocBytes      uint64
	TotalAllocBytes uint64
	SysBytes        uint64
	HeapAllocBytes  uint64
	HeapSysBytes    uint64
	HeapObjects     uint64
	Mallocs         uint64
	Frees           uint64
	GCCycles        uint32
	GCPauseNs       uint64
	Goroutines      int
	CgoCalls        int64
}

type Snapshot

type Snapshot struct {
	At      time.Time
	IO      ProcessIO
	Runtime RuntimeStats
	DB      DBStats
	IOOK    bool
	DBOK    bool
}

Jump to

Keyboard shortcuts

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