limiting

package
v0.0.0-...-5d73d95 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryConsumptionTracker

type MemoryConsumptionTracker struct {
	MaxEstimatedMemoryConsumptionBytes     uint64
	CurrentEstimatedMemoryConsumptionBytes uint64
	PeakEstimatedMemoryConsumptionBytes    uint64
	// contains filtered or unexported fields
}

MemoryConsumptionTracker tracks the current memory utilisation of a single query, and applies any max in-memory bytes limit.

It also tracks the peak number of in-memory bytes for use in query statistics.

It is not safe to use this type from multiple goroutines simultaneously.

func NewMemoryConsumptionTracker

func NewMemoryConsumptionTracker(maxEstimatedMemoryConsumptionBytes uint64, rejectionCount prometheus.Counter) *MemoryConsumptionTracker

func (*MemoryConsumptionTracker) DecreaseMemoryConsumption

func (l *MemoryConsumptionTracker) DecreaseMemoryConsumption(b uint64)

DecreaseMemoryConsumption decreases the current memory consumption by b bytes.

func (*MemoryConsumptionTracker) IncreaseMemoryConsumption

func (l *MemoryConsumptionTracker) IncreaseMemoryConsumption(b uint64) error

IncreaseMemoryConsumption attempts to increase the current memory consumption by b bytes.

It returns an error if the query would exceed the maximum memory consumption limit.

Jump to

Keyboard shortcuts

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