dashboard/app: dedup changes in UI
Currently for every benchmark/metric we show all changes for all builders x procs. With 4 builders and 5 procs, that's 20 changes (20 red/green boxes in a single cell). Instead show only maximum change for every benchmark/metric. This significantly reduces clutter in UI. When you click on the red/green box, you can see the rest of the changes. LGTM=adg R=adg CC=golang-codereviews https://golang.org/cl/126430043
This commit is contained in:
parent
1d2a500105
commit
5d476c5293
|
|
@ -132,6 +132,7 @@ func handleOneCommit(pc *PerfConfig, com *Commit, rc *PerfResultCache, baseRes *
|
|||
}
|
||||
}
|
||||
changes := significantPerfChanges(pc, builder, res0, res1)
|
||||
changes = dedupPerfChanges(changes)
|
||||
for _, ch := range changes {
|
||||
v := new(perfChangesChange)
|
||||
v.Builder = builder
|
||||
|
|
@ -165,6 +166,34 @@ func handleOneCommit(pc *PerfConfig, com *Commit, rc *PerfResultCache, baseRes *
|
|||
return uiCom, nil
|
||||
}
|
||||
|
||||
// Find builder-procs with the maximum absolute diff for every benchmark-metric, drop the rest.
|
||||
func dedupPerfChanges(changes []*PerfChange) (deduped []*PerfChange) {
|
||||
maxDiff := make(map[string]float64)
|
||||
maxBench := make(map[string]string)
|
||||
// First, find the maximum.
|
||||
for _, ch := range changes {
|
||||
bench, _ := splitBench(ch.Bench)
|
||||
k := bench + "|" + ch.Metric
|
||||
v := ch.Diff
|
||||
if v < 0 {
|
||||
v = -v
|
||||
}
|
||||
if maxDiff[k] < v {
|
||||
maxDiff[k] = v
|
||||
maxBench[k] = ch.Builder + "|" + ch.Bench
|
||||
}
|
||||
}
|
||||
// Then, remove the rest.
|
||||
for _, ch := range changes {
|
||||
bench, _ := splitBench(ch.Bench)
|
||||
k := bench + "|" + ch.Metric
|
||||
if maxBench[k] == ch.Builder+"|"+ch.Bench {
|
||||
deduped = append(deduped, ch)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func findMetric(c *perfChangesCommit, metric string) *perfChangesMetric {
|
||||
for _, m := range c.Metrics {
|
||||
if m.Name == metric {
|
||||
|
|
|
|||
Loading…
Reference in New Issue