dbtracker

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrackMinInterval = 60 * time.Second
	TopTablesN       = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeEmitter

type ChangeEmitter interface {
	Emit(change schema.Change, dbSystem, targetAddr string)
}

type CollectFunc

type CollectFunc func(ctx context.Context) (schema.Snapshot, map[string]*DBSizeSnapshot, error)

type DBSizeSnapshot

type DBSizeSnapshot struct {
	DatabaseSize float64
	Tables       []TableSizeEntry
}

type TableGrowthEntry

type TableGrowthEntry struct {
	schema.TableKey
	Growth float64
}

type TableSizeEntry

type TableSizeEntry struct {
	schema.TableKey
	Size float64
}

type Tracker

type Tracker struct {
	DBSizes map[string]*DBSizeSnapshot

	TableGrowth []TableGrowthEntry
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(dbSystem string, trackSchema, trackSizes bool, collect CollectFunc, logger logger.Logger) *Tracker

func (*Tracker) Track

func (t *Tracker) Track(ctx context.Context, emitter ChangeEmitter, targetAddr string)

Jump to

Keyboard shortcuts

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