algorithms

package
v0.0.0-...-128afb8 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

AlgorithmsVersion is the version of the set of algorithms used. Changing the set of algorithms below (including add, update or deletion of an algorithm) should result in this version being incremented.

In case of algorithm deletion, make sure to update this constant appropriately to ensure the AlgorithmsVersion still increases (I.E. DO NOT simply delete "+ <myalgorithm>.AlgorithmVersion" when deleting an algorithm without rolling its value (plus one) into the constant.)

Variables

View Source
var ErrAlgorithmNotExist = errors.New("algorithm does not exist")

ErrAlgorithmNotExist is returned if an algorithm with the given name does not exist. This may indicate the algorithm is newer or older than the current version.

Functions

func Cluster

Cluster performs (incremental re-)clustering of the given test failures using all registered clustering algorithms and the specified set of failure association rules and config.

If the test results have not been previously clustered, pass an existing ClusterResults of NewEmptyClusterResults(...) to cluster test results from scratch.

If the test results have been previously clustered, pass the ClusterResults returned by the last call to Cluster.

Cluster(...) will always return a set of ClusterResults which are as- or more-recent than the existing ClusterResults. This is defined as the following postcondition:

returned.AlgorithmsVersion > existing.AlgorithmsVersion ||
(returned.AlgorithmsVersion == existing.AlgorithmsVersion &&
  returned.ConfigVersion >= existing.ConfigVersion &&
  returned.RulesVersion >= existing.RulesVersion)

func NewEmptyClusterResults

func NewEmptyClusterResults(count int) clustering.ClusterResults

NewEmptyClusterResults returns a new ClusterResults for a list of test results of length count. The ClusterResults will indicate the test results have not been clustered.

func TestClusteringConfig

func TestClusteringConfig() *configpb.Clustering

TestClusteringConfig returns standard clustering configuration that can be used for testing.

Types

type Algorithm

type Algorithm interface {
	// Name returns the identifier of the clustering algorithm.
	Name() string
	// Cluster clusters the given test failure and returns its cluster ID (if
	// it can be clustered) or nil otherwise. THe returned cluster ID must be
	// at most 16 bytes.
	Cluster(config *compiledcfg.ProjectConfig, failure *clustering.Failure) []byte
	// FailureAssociationRule returns a failure association rule that
	// captures the definition of the cluster containing the given example.
	FailureAssociationRule(config *compiledcfg.ProjectConfig, example *clustering.Failure) string
	// ClusterTitle returns the unhashed clustering key which is common
	// across all test results in a cluster. This will be displayed
	// on the cluster page or cluster listing.
	ClusterTitle(config *compiledcfg.ProjectConfig, example *clustering.Failure) string
	// ClusterDescription returns a description of the cluster, for use when
	// filing bugs, with the help of the given example failure.
	ClusterDescription(config *compiledcfg.ProjectConfig, summary *clustering.ClusterSummary) (*clustering.ClusterDescription, error)
}

Algorithm represents the interface that each clustering algorithm generating suggested clusters must implement.

func SuggestingAlgorithm

func SuggestingAlgorithm(algorithm string) (Algorithm, error)

SuggestingAlgorithm returns the algorithm for generating suggested clusters with the given name. If the algorithm does not exist, ErrAlgorithmNotExist is returned.

Directories

Path Synopsis
Package failurereason contains the failure reason clustering algorithm for LUCI Analysis.
Package failurereason contains the failure reason clustering algorithm for LUCI Analysis.
Package testname contains the test name-based clustering algorithm for LUCI Analysis.
Package testname contains the test name-based clustering algorithm for LUCI Analysis.
rules
Package rules provides methods to evaluate test name clustering rules.
Package rules provides methods to evaluate test name clustering rules.

Jump to

Keyboard shortcuts

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