Documentation ¶
Index ¶
- type BlameDistribution
- type Blamer
- func (b *Blamer) Calculate(tile *tiling.Tile) error
- func (b *Blamer) GetAllBlameLists() (map[string]map[string]*BlameDistribution, []*tiling.Commit)
- func (b *Blamer) GetBlame(testName string, digest string, commits []*tiling.Commit) *BlameDistribution
- func (b *Blamer) GetBlamesForTest(testName string) []*WeightedBlame
- type WeightedBlame
- type WeightedBlameSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlameDistribution ¶
type BlameDistribution struct { // Freq contains likelihood counts that a commit was responsible // for the observed digest. The counts apply to the last len(Freq) // commits. When used as output structure in the GetBlame function // Freq contains the indices of commits. Freq []int `json:"freq"` // Old indicates whether the digest has been seen prior to the current // tile. In that case the blame might be unreliable. Old bool `json:"old"` }
BlameDistribution contains a rough estimation of the probabilities that a commit was responsible for the contained digest. We also use it as the output structure for the front end.
type Blamer ¶
type Blamer struct {
// contains filtered or unexported fields
}
Blamer calculates blame lists by continously loading tiles and changed expectations. It is not thread safe. The client of this package needs to make sure there are no conflicts.
func New ¶
New returns a new Blamer instance and error. The error is not nil if the first run of calculating the blame lists failed.
func (*Blamer) GetAllBlameLists ¶
func (*Blamer) GetBlame ¶
func (b *Blamer) GetBlame(testName string, digest string, commits []*tiling.Commit) *BlameDistribution
GetBlame returns the indices of the provided list of commits that likely caused the given test name/digest pair. If the result is empty we are not able to determine blame, because the test name/digest appeared prior to the current tile.
func (*Blamer) GetBlamesForTest ¶
func (b *Blamer) GetBlamesForTest(testName string) []*WeightedBlame
GetBlamesForTest returns the list of authors that have blame assigned to them for the given test.
type WeightedBlame ¶
WeightedBlame combines an authors name with a probabily that she is on a blamelist this is aggregated over the digests of a test.
type WeightedBlameSlice ¶
type WeightedBlameSlice []*WeightedBlame
Sorting wrapper around WeightedBlame.
func (WeightedBlameSlice) Len ¶
func (w WeightedBlameSlice) Len() int
func (WeightedBlameSlice) Less ¶
func (w WeightedBlameSlice) Less(i, j int) bool
func (WeightedBlameSlice) Swap ¶
func (w WeightedBlameSlice) Swap(i, j int)