mirror of
https://github.com/golang/go
synced 2024-11-18 15:04:44 -07:00
dashboard/app: allow to gob-encode PerfChange
Currently appspot logs say: delay: gob encoding failed: gob: type build.PerfChange has no exported fields And I was thinking why it is not sending mails... LGTM=adg R=adg CC=golang-codereviews https://golang.org/cl/125480043
This commit is contained in:
parent
e8a1924bfb
commit
1d2a500105
@ -306,16 +306,16 @@ func sendPerfMailFunc(c appengine.Context, com *Commit, prevCommitHash, builder
|
||||
// Find the benchmark.
|
||||
var b *PerfChangeBenchmark
|
||||
for _, b1 := range benchmarks {
|
||||
if b1.Name == ch.bench {
|
||||
if b1.Name == ch.Bench {
|
||||
b = b1
|
||||
break
|
||||
}
|
||||
}
|
||||
if b == nil {
|
||||
b = &PerfChangeBenchmark{Name: ch.bench}
|
||||
b = &PerfChangeBenchmark{Name: ch.Bench}
|
||||
benchmarks = append(benchmarks, b)
|
||||
}
|
||||
b.Metrics = append(b.Metrics, &PerfChangeMetric{Name: ch.metric, Old: ch.old, New: ch.new, Delta: ch.diff})
|
||||
b.Metrics = append(b.Metrics, &PerfChangeMetric{Name: ch.Metric, Old: ch.Old, New: ch.New, Delta: ch.Diff})
|
||||
}
|
||||
for _, b := range benchmarks {
|
||||
sort.Sort(PerfChangeMetricSlice(b.Metrics))
|
||||
|
@ -176,12 +176,12 @@ func (rc *PerfResultCache) NextForComparison(commitNum int, builder string) (*Pe
|
||||
}
|
||||
|
||||
type PerfChange struct {
|
||||
builder string
|
||||
bench string
|
||||
metric string
|
||||
old uint64
|
||||
new uint64
|
||||
diff float64
|
||||
Builder string
|
||||
Bench string
|
||||
Metric string
|
||||
Old uint64
|
||||
New uint64
|
||||
Diff float64
|
||||
}
|
||||
|
||||
func significantPerfChanges(pc *PerfConfig, builder string, prevRes, res *PerfResult) (changes []*PerfChange) {
|
||||
@ -210,7 +210,7 @@ func significantPerfChanges(pc *PerfConfig, builder string, prevRes, res *PerfRe
|
||||
if isNoise(diff, noise) {
|
||||
continue
|
||||
}
|
||||
ch := &PerfChange{builder: builder, bench: benchmark, metric: metric, old: val0, new: val, diff: diff}
|
||||
ch := &PerfChange{Builder: builder, Bench: benchmark, Metric: metric, Old: val0, New: val, Diff: diff}
|
||||
changes = append(changes, ch)
|
||||
}
|
||||
}
|
||||
@ -220,17 +220,17 @@ func significantPerfChanges(pc *PerfConfig, builder string, prevRes, res *PerfRe
|
||||
majority := len(pc.ProcList(builder))/2 + 1
|
||||
cnt := make(map[string]int)
|
||||
for _, ch := range changes {
|
||||
b, _ := splitBench(ch.bench)
|
||||
name := b + "|" + ch.metric
|
||||
if ch.diff < 0 {
|
||||
b, _ := splitBench(ch.Bench)
|
||||
name := b + "|" + ch.Metric
|
||||
if ch.Diff < 0 {
|
||||
name += "--"
|
||||
}
|
||||
cnt[name] = cnt[name] + 1
|
||||
}
|
||||
for i := 0; i < len(changes); i++ {
|
||||
ch := changes[i]
|
||||
b, _ := splitBench(ch.bench)
|
||||
name := b + "|" + ch.metric
|
||||
b, _ := splitBench(ch.Bench)
|
||||
name := b + "|" + ch.Metric
|
||||
if cnt[name] >= majority {
|
||||
continue
|
||||
}
|
||||
|
@ -135,12 +135,12 @@ func handleOneCommit(pc *PerfConfig, com *Commit, rc *PerfResultCache, baseRes *
|
||||
for _, ch := range changes {
|
||||
v := new(perfChangesChange)
|
||||
v.Builder = builder
|
||||
v.Benchmark, v.Procs = splitBench(ch.bench)
|
||||
v.diff = ch.diff
|
||||
v.Val = fmt.Sprintf("%+.2f%%", ch.diff)
|
||||
v.Hint = fmt.Sprintf("%v/%v", builder, ch.bench)
|
||||
v.Benchmark, v.Procs = splitBench(ch.Bench)
|
||||
v.diff = ch.Diff
|
||||
v.Val = fmt.Sprintf("%+.2f%%", ch.Diff)
|
||||
v.Hint = fmt.Sprintf("%v/%v", builder, ch.Bench)
|
||||
v.Link = fmt.Sprintf("perfdetail?commit=%v&commit0=%v&builder=%v&benchmark=%v", com.Hash, res0.CommitHash, builder, v.Benchmark)
|
||||
m := findMetric(uiCom, ch.metric)
|
||||
m := findMetric(uiCom, ch.Metric)
|
||||
if v.diff > 0 {
|
||||
v.Style = "bad"
|
||||
m.BadChanges = append(m.BadChanges, v)
|
||||
|
Loading…
Reference in New Issue
Block a user