Documentation ¶
Index ¶
Constants ¶
const AlgorithmVersion = 3
AlgorithmVersion is the version of the clustering algorithm. The algorithm version should be incremented whenever existing test results may be clustered differently (i.e. Cluster(f) returns a different value for some f that may have been already ingested).
Variables ¶
var AlgorithmName = fmt.Sprintf("%sv%v", clustering.RulesAlgorithmPrefix, AlgorithmVersion)
AlgorithmName is the identifier for the clustering algorithm. LUCI Analysis requires all clustering algorithms to have a unique identifier. Must match the pattern ^[a-z0-9-.]{1,32}$.
The AlgorithmName must encode the algorithm version, so that each version of an algorithm has a different name.
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm struct{}
func (*Algorithm) Cluster ¶
func (a *Algorithm) Cluster(ruleset *cache.Ruleset, existingRulesVersion time.Time, ruleIDs map[string]struct{}, failure *clustering.Failure)
Cluster incrementally (re-)clusters the given test failure, updating the matched cluster IDs. The passed existingRulesVersion and ruleIDs should be the ruleset.RulesVersion and cluster IDs of the previous call to Cluster (if any) from which incremental clustering should occur.
If clustering has not been performed previously, and clustering is to be performed from scratch, existingRulesVersion should be rules.StartingEpoch and ruleIDs should be an empty list.
This method is on the performance-critical path for re-clustering.
To avoid unnecessary allocations, the method will modify the passed ruleIDs.