MCPcopy Create free account
hub / github.com/cel-expr/cel-go / MemoryTracking

Function MemoryTracking

cel/options.go:947–953  ·  view source on GitHub ↗

MemoryTracking enables peak memory tracking during evaluation with an optional set of types.MemoryTrackerOption values to configure the tracker's size calculator, sample interval, and limit behaviors. Peak memory is measured in aggregate element counts as computed by a types.SizeCalculator and is o

(memOpts ...types.MemoryTrackerOption)

Source from the content-addressed store, hash-verified

945// attributes, call results, constructed aggregates, and comprehension results. The peak
946// watermark is available via the EvalDetails.PeakMemory() method.
947func MemoryTracking(memOpts ...types.MemoryTrackerOption) ProgramOption {
948 return func(p *prog) (*prog, error) {
949 p.memoryOptions = append(p.memoryOptions, memOpts...)
950 p.evalOpts |= OptTrackMemory
951 return p, nil
952 }
953}
954
955// MemoryLimit enables memory tracking and configures program evaluation to exit early with a
956// "memory limit exceeded" error if the peak tracked memory exceeds the limit.

Calls

no outgoing calls