Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(781)

Side by Side Diff: golden/go/analysis/triage.go

Issue 884943003: Ignore traces (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « golden/go/analysis/status.go ('k') | golden/go/diff/diff.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package analysis 1 package analysis
2 2
3 import ( 3 import (
4 "sort" 4 "sort"
5 5
6 "github.com/skia-dev/glog" 6 "github.com/skia-dev/glog"
7 7
8 "skia.googlesource.com/buildbot.git/golden/go/types" 8 "skia.googlesource.com/buildbot.git/golden/go/types"
9 ptypes "skia.googlesource.com/buildbot.git/perf/go/types" 9 ptypes "skia.googlesource.com/buildbot.git/perf/go/types"
10 ) 10 )
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 // GUITestDetailSortable is a wrapper to sort a slice of GUITestDetail. 76 // GUITestDetailSortable is a wrapper to sort a slice of GUITestDetail.
77 type GUITestDetailSortable []*GUITestDetail 77 type GUITestDetailSortable []*GUITestDetail
78 78
79 func (g GUITestDetailSortable) Len() int { return len(g) } 79 func (g GUITestDetailSortable) Len() int { return len(g) }
80 func (g GUITestDetailSortable) Swap(i, j int) { g[i], g[j] = g[j], g[i] } 80 func (g GUITestDetailSortable) Swap(i, j int) { g[i], g[j] = g[j], g[i] }
81 func (g GUITestDetailSortable) Less(i, j int) bool { return g[i].Name < g[j].Nam e } 81 func (g GUITestDetailSortable) Less(i, j int) bool { return g[i].Name < g[j].Nam e }
82 82
83 // getTestDetails processes a tile and calculates the diff metrics for all 83 // getTestDetails processes a tile and calculates the diff metrics for all
84 // untriaged digests. 84 // untriaged digests.
85 func (a *Analyzer) getTestDetails(labeledTile *LabeledTile) *GUITestDetails { 85 func (a *Analyzer) getTestDetails(state *AnalyzeState) *GUITestDetails {
86 » glog.Infof("Latest commit: %v", labeledTile.Commits[len(labeledTile.Comm its)-1]) 86 » glog.Infof("Latest commit: %v", state.Tile.Commits[len(state.Tile.Commit s)-1])
87 glog.Infoln("Starting to extract test details.") 87 glog.Infoln("Starting to extract test details.")
88 » nTests := len(labeledTile.Traces) 88 » nTests := len(state.Tile.Traces)
89 resultCh := make(chan *GUITestDetail, nTests) 89 resultCh := make(chan *GUITestDetail, nTests)
90 90
91 » for testName, testTraces := range labeledTile.Traces { 91 » for testName, testTraces := range state.Tile.Traces {
92 go a.processOneTestDetail(testName, testTraces, resultCh) 92 go a.processOneTestDetail(testName, testTraces, resultCh)
93 } 93 }
94 94
95 // Wait for the results to finish. 95 // Wait for the results to finish.
96 result := make([]*GUITestDetail, 0, nTests) 96 result := make([]*GUITestDetail, 0, nTests)
97 for i := 0; i < nTests; i++ { 97 for i := 0; i < nTests; i++ {
98 result = append(result, <-resultCh) 98 result = append(result, <-resultCh)
99 glog.Infof("Processed %d/%d tests. (%f%%)", len(result), nTests, float64(len(result))/float64(nTests)*100.0) 99 glog.Infof("Processed %d/%d tests. (%f%%)", len(result), nTests, float64(len(result))/float64(nTests)*100.0)
100 } 100 }
101 101
102 // Sort the resulting tests by name. 102 // Sort the resulting tests by name.
103 sort.Sort(GUITestDetailSortable(result)) 103 sort.Sort(GUITestDetailSortable(result))
104 104
105 // Build the test lookup map. 105 // Build the test lookup map.
106 testsMap := make(map[string]int, nTests) 106 testsMap := make(map[string]int, nTests)
107 for idx, t := range result { 107 for idx, t := range result {
108 testsMap[t.Name] = idx 108 testsMap[t.Name] = idx
109 } 109 }
110 110
111 glog.Infoln("Done extracting test details.") 111 glog.Infoln("Done extracting test details.")
112 112
113 return &GUITestDetails{ 113 return &GUITestDetails{
114 » » Commits: labeledTile.Commits, 114 » » Commits: state.Tile.Commits,
115 » » CommitsByDigest: labeledTile.CommitsByDigest, 115 » » CommitsByDigest: state.Tile.CommitsByDigest,
116 » » AllParams: a.currentIndex.getAllParams(nil), 116 » » AllParams: state.Index.getAllParams(nil),
117 Tests: result, 117 Tests: result,
118 testsMap: testsMap, 118 testsMap: testsMap,
119 } 119 }
120 } 120 }
121 121
122 func (a *Analyzer) updateTestDetails(labeledTestDigests map[string]types.TestCla ssification) { 122 func (a *Analyzer) updateTestDetails(labeledTestDigests map[string]types.TestCla ssification, state *AnalyzeState) {
123 » glog.Infof("Latest commit: %v", a.currentTestDetails.Commits[len(a.curre ntTestDetails.Commits)-1]) 123 » glog.Infof("Latest commit: %v", state.TestDetails.Commits[len(state.Test Details.Commits)-1])
124 glog.Infoln("Starting to update test details.") 124 glog.Infoln("Starting to update test details.")
125 nTests := len(labeledTestDigests) 125 nTests := len(labeledTestDigests)
126 resultCh := make(chan *GUITestDetail, nTests) 126 resultCh := make(chan *GUITestDetail, nTests)
127 127
128 for testName := range labeledTestDigests { 128 for testName := range labeledTestDigests {
129 » » go a.processOneTestDetail(testName, a.currentTile.Traces[testNam e], resultCh) 129 » » go a.processOneTestDetail(testName, state.Tile.Traces[testName], resultCh)
130 } 130 }
131 131
132 // Wait for the results to finish. 132 // Wait for the results to finish.
133 » curr := a.currentTestDetails.Tests 133 » curr := state.TestDetails.Tests
134 for i := 0; i < nTests; i++ { 134 for i := 0; i < nTests; i++ {
135 result := <-resultCh 135 result := <-resultCh
136 136
137 // find the result in the current tile and replace it. 137 // find the result in the current tile and replace it.
138 idx := sort.Search(len(curr), func(j int) bool { return curr[j]. Name >= result.Name }) 138 idx := sort.Search(len(curr), func(j int) bool { return curr[j]. Name >= result.Name })
139 // We found the entry. 139 // We found the entry.
140 if (idx < len(curr)) && (curr[idx].Name == result.Name) { 140 if (idx < len(curr)) && (curr[idx].Name == result.Name) {
141 curr[idx] = result 141 curr[idx] = result
142 } else {
143 glog.Errorf("Unable to find test '%s'", result.Name)
144 } 142 }
145 } 143 }
146 144
147 glog.Infoln("Done updating test details.") 145 glog.Infoln("Done updating test details.")
148 } 146 }
149 147
150 func (a *Analyzer) processOneTestDetail(testName string, testTraces []*LabeledTr ace, resultCh chan<- *GUITestDetail) { 148 func (a *Analyzer) processOneTestDetail(testName string, testTraces []*LabeledTr ace, resultCh chan<- *GUITestDetail) {
151 untriagedDigests := map[string]*GUIUntriagedDigest{} 149 untriagedDigests := map[string]*GUIUntriagedDigest{}
152 positiveDigests := map[string]*DigestInfo{} 150 positiveDigests := map[string]*DigestInfo{}
153 negativeDigests := map[string]*DigestInfo{} 151 negativeDigests := map[string]*DigestInfo{}
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 result = append(result, &GUIDiffMetric{ 308 result = append(result, &GUIDiffMetric{
311 NumDiffPixels: dm.NumDiffPixels, 309 NumDiffPixels: dm.NumDiffPixels,
312 PixelDiffPercent: dm.PixelDiffPercent, 310 PixelDiffPercent: dm.PixelDiffPercent,
313 MaxRGBADiffs: dm.MaxRGBADiffs, 311 MaxRGBADiffs: dm.MaxRGBADiffs,
314 DiffImgUrl: a.pathToURLConverter(dm.PixelDiffFileP ath), 312 DiffImgUrl: a.pathToURLConverter(dm.PixelDiffFileP ath),
315 PosDigest: posDigest, 313 PosDigest: posDigest,
316 }) 314 })
317 } 315 }
318 return result 316 return result
319 } 317 }
OLDNEW
« no previous file with comments | « golden/go/analysis/status.go ('k') | golden/go/diff/diff.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698