capture

package
v6.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package capture writes bounded run recordings independently of database work.

Index

Constants

View Source
const (
	DefaultMaxBytes = 64 << 20
	MaxRecordBytes  = 256 << 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Directory string
	Logs      bool
	Metrics   bool
	Interval  time.Duration
	MaxBytes  int64
	ReportID  string
	RunID     string
}

Options selects independently optional streams and per-stream byte budgets.

type Writer

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

Writer owns one fresh UUID directory. Producers never wait for disk writes.

func New

func New(options Options) (*Writer, error)

New creates recording files exclusively before workload execution.

func (*Writer) Add

func (w *Writer) Add(name string, value any)

Add encodes a record outside the file writer; oversize records are counted.

func (*Writer) Close

func (w *Writer) Close() *report.Capture

Close joins all writes and publishes terminal loss/error accounting.

func (*Writer) Dropped

func (w *Writer) Dropped(name string)

func (*Writer) Elapsed

func (w *Writer) Elapsed(now time.Time) float64

func (*Writer) Enabled

func (w *Writer) Enabled(name string) bool

func (*Writer) Enqueue

func (w *Writer) Enqueue(name string, data []byte)

Enqueue copies bounded data and drops immediately when capture cannot keep up.

func (*Writer) Event

func (w *Writer) Event(kind, step, state string, workers int, duration, drain time.Duration)

func (*Writer) ID

func (w *Writer) ID() string

func (*Writer) Logger

func (w *Writer) Logger(original *zap.Logger) *zap.Logger

Logger tees run-owned structured logs without changing output or effective level.

func (*Writer) Missed

func (w *Writer) Missed(count uint64)

func (*Writer) ReportID

func (w *Writer) ReportID() string

Jump to

Keyboard shortcuts

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