Commit 5a6afbd2 authored by Quentin Smith's avatar Quentin Smith

analysis/app: work around bug in SortBy

SortBy seems to sometimes sort by the second column instead of the
first. Until that bug is figured out, do the sorting one column at a
time to control the ordering.

Without this patch, try
/trend?q=upload%3A20170216.3+name%3ARegexpMatchEasy0_1K&raw=1
and
/trend?q=trend%3Abuild.golang.org%2Fwindows-amd64-gce+name%3AGzip+commit-time%3E2016-11-08+commit-time%3C2016-11-30&raw=1

The former seems to sort first by "commit" instead of "commit-time",
but the latter sorts by "commit-time" first. Apply the patch and both
are sorted by commit-time.

Change-Id: I8ebd2720fa1147fc1d468a6bab515a224537a98e
Reviewed-on: https://go-review.googlesource.com/37471
Run-TryBot: Quentin Smith <quentin@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent a03b4c90
......@@ -245,7 +245,11 @@ func plot(t table.Grouping, resultCols []string, opt plotOptions) table.Grouping
if opt.x == "" {
opt.x = "commit"
}
t = table.SortBy(t, "commit-time", opt.x)
// TODO(quentin): One SortBy call should do this, but
// sometimes it seems to sort by the second column instead of
// the first. Do them in separate steps until SortBy is fixed.
t = table.SortBy(t, opt.x)
t = table.SortBy(t, "commit-time")
t = colIndex{col: opt.x}.F(t)
// Unpivot all of the metrics into one column.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment