perfmetrics

package
v2.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: GPL-3.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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