dbg

package
v0.0.0-...-e414cd4 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TODO(AD): Remove chaindata specific
	// force skipping of any non-Erigon2 .torrent files
	DownloaderOnlyBlocks = EnvBool("DOWNLOADER_ONLY_BLOCKS", false)
)
View Source
var StagesOnlyBlocks = EnvBool("STAGES_ONLY_BLOCKS", false)

Functions

func BigRoTxKb

func BigRoTxKb(ctx context.Context) uint

DEBUG_BIG_RO_TX_KB - print logs with info about large read-only transactions DEBUG_BIG_RW_TX_KB - print logs with info about large read-write transactions DEBUG_SLOW_COMMIT_MS - print logs with commit timing details if commit is slower than this threshold

func BigRwTxKb

func BigRwTxKb(ctx context.Context) uint

func DirtySpace

func DirtySpace(ctx context.Context) uint64

func DiscardHistory

func DiscardHistory(ctx context.Context) bool

func DoMemStat

func DoMemStat() bool

func EnvBool

func EnvBool(envVarName string, defaultVal bool) bool

func EnvDataSize

func EnvDataSize(envVarName string, defaultVal datasize.ByteSize) datasize.ByteSize

func EnvInt

func EnvInt(envVarName string, defaultVal int) int

func EnvString

func EnvString(envVarName string, defaultVal string) string

func LogHashMismatchReason

func LogHashMismatchReason(ctx context.Context) bool

func MdbxReadAhead

func MdbxReadAhead(ctx context.Context) bool

func MergeTr

func MergeTr(ctx context.Context) int

func NoSync

func NoSync(ctx context.Context) bool

func ReadMemStats

func ReadMemStats(m *runtime.MemStats)

func SlowCommit

func SlowCommit(ctx context.Context) time.Duration

func SlowTx

func SlowTx(ctx context.Context) time.Duration

func SnapshotVersion

func SnapshotVersion(ctx context.Context) uint8

func Stack

func Stack() string

Stack returns stack-trace in logger-friendly compact formatting

func StackSkip

func StackSkip(skip int) string

func StopAfterReconst

func StopAfterReconst(ctx context.Context) bool

func StopAfterStage

func StopAfterStage(ctx context.Context) string

TODO(allada) We should possibly consider removing `STOP_BEFORE_STAGE`, as `STOP_AFTER_STAGE` can perform all same the functionality, but due to reverse compatibility reasons we are going to leave it.

func StopBeforeStage

func StopBeforeStage(ctx context.Context) string

func WriteMap

func WriteMap(ctx context.Context) bool

Types

type LeakDetector

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

LeakDetector - use it to find which resource was created but not closed (leaked) periodically does print in logs resources which living longer than 1min with their creation stack trace For example db transactions can call Add/Del from Begin/Commit/Rollback methods

func NewLeakDetector

func NewLeakDetector(ctx context.Context, name string, slowThreshold time.Duration) *LeakDetector

func (*LeakDetector) Add

func (d *LeakDetector) Add() uint64

func (*LeakDetector) Del

func (d *LeakDetector) Del(id uint64)

func (*LeakDetector) Enabled

func (d *LeakDetector) Enabled() bool

func (*LeakDetector) SetSlowThreshold

func (d *LeakDetector) SetSlowThreshold(t time.Duration)

type LeakDetectorItem

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

Jump to

Keyboard shortcuts

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