Documentation ¶
Index ¶
- type Meter
- func (m *Meter) ComputationIntensities() interfaceMeter.MeteredComputationIntensities
- func (m *Meter) MemoryIntensities() interfaceMeter.MeteredMemoryIntensities
- func (m *Meter) MergeMeter(child interfaceMeter.Meter, enforceLimits bool) error
- func (m *Meter) MeterComputation(kind common.ComputationKind, intensity uint) error
- func (m *Meter) MeterMemory(kind common.MemoryKind, intensity uint) error
- func (m *Meter) NewChild() interfaceMeter.Meter
- func (m *Meter) TotalComputationLimit() uint
- func (m *Meter) TotalComputationUsed() uint
- func (m *Meter) TotalMemoryLimit() uint
- func (m *Meter) TotalMemoryUsed() uint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Meter ¶
type Meter struct {
// contains filtered or unexported fields
}
Meter collects memory and computation usage and enforces limits for any each memory/computation usage call it sums intensity to the total memory/computation usage metrics and returns error if limits are not met.
func (*Meter) ComputationIntensities ¶
func (m *Meter) ComputationIntensities() interfaceMeter.MeteredComputationIntensities
ComputationIntensities returns all the measured computational intensities
func (*Meter) MemoryIntensities ¶
func (m *Meter) MemoryIntensities() interfaceMeter.MeteredMemoryIntensities
MemoryIntensities returns all the measured memory intensities
func (*Meter) MergeMeter ¶
func (m *Meter) MergeMeter(child interfaceMeter.Meter, enforceLimits bool) error
MergeMeter merges the input meter into the current meter and checks for the limits
func (*Meter) MeterComputation ¶
func (m *Meter) MeterComputation(kind common.ComputationKind, intensity uint) error
MeterComputation captures computation usage and returns an error if it goes beyond the limit
func (*Meter) MeterMemory ¶
func (m *Meter) MeterMemory(kind common.MemoryKind, intensity uint) error
MeterMemory captures memory usage and returns an error if it goes beyond the limit
func (*Meter) NewChild ¶
func (m *Meter) NewChild() interfaceMeter.Meter
NewChild construct a new Meter instance with the same limits as parent
func (*Meter) TotalComputationLimit ¶
TotalComputationLimit returns the total computation limit
func (*Meter) TotalComputationUsed ¶
TotalComputationUsed returns the total computation used
func (*Meter) TotalMemoryLimit ¶
TotalMemoryLimit returns the total memory limit
func (*Meter) TotalMemoryUsed ¶
TotalMemoryUsed returns the total memory used