stats

package
v0.5.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package stats is an experimental package for getting statistics on CUE evaluations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counts

type Counts struct {

	// Unifications counts the number of calls to adt.Unify
	Unifications int

	// Disjuncts indicates the number of total disjuncts processed as part
	// of a Unify operation. A unification with no | operator counts as a
	// single disjunct, so Disjuncts is always greater than or equal to the
	// number of Unifications.
	//
	// If Disjuncts is much larger than Unification, this may indicate room
	// for optimization. In particular, most practical uses of disjunctions
	// should allow for near-linear processing.
	Disjuncts int

	// Conjuncts is an estimate of the number of conjunctions processed during
	// the calls to Unify. This includes the conjuncts added in the compilation
	// phase as well as the derivative conjuncts inserted from other nodes
	// after following references.
	//
	// A number of Conjuncts much larger than Disjuncts may indicate non-linear
	// algorithmic behavior.
	Conjuncts int

	Freed    int // Number of buffers returned to the free pool.
	Reused   int // Number of times a buffer is reused instead of allocated.
	Allocs   int // Total number of allocated buffer objects.
	Retained int // Number of times a buffer is retained upon finalization.
}

Counts holds counters for key events during a CUE evaluation.

This is an experimental type and the contents may change without notice.

func (*Counts) Add

func (c *Counts) Add(other Counts)

func (Counts) Leaks

func (s Counts) Leaks() int

Leaks reports the number of nodeContext structs leaked. These are typically benign, as they will just be garbage collected, as long as the pointer from the original nodes has been eliminated or the original nodes are also not referred to. But Leaks may have notable impact on performance, and thus should be avoided.

func (Counts) Since

func (c Counts) Since(start Counts) Counts

func (Counts) String

func (s Counts) String() string

Jump to

Keyboard shortcuts

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