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

Unified Diff: perf/go/parser/parser_test.go

Issue 610793003: Add ratio calculation to take the ratio of two calculations. (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: ... Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« perf/go/parser/funcs.go ('K') | « perf/go/parser/parser.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: perf/go/parser/parser_test.go
diff --git a/perf/go/parser/parser_test.go b/perf/go/parser/parser_test.go
index 71fbebf5790e8fea8292a02584a59d684212c3ad..e4fc45c13bba640d9e5148420aa5e63802e7c1b0 100644
--- a/perf/go/parser/parser_test.go
+++ b/perf/go/parser/parser_test.go
@@ -131,6 +131,20 @@ func TestAve(t *testing.T) {
}
}
+func TestRatio(t *testing.T) {
+ ctx := newTestContext()
+ ctx.Tile.Traces["t1"].(*types.PerfTrace).Values = []float64{10, 4, 100, 50}
+ ctx.Tile.Traces["t2"].(*types.PerfTrace).Values = []float64{5, 2, 4, 5}
+
+ traces, err := ctx.Eval(`ratio(
+ ave(fill(filter("source_type=skp&config=gpu&bench_type=playback"))),
jcgregorio 2014/10/17 11:43:55 ave(fill(filter("config=gpu"))),
tfarina 2014/10/17 21:14:23 Done.
+ ave(fill(filter("source_type=skp&config=8888&bench_type=playback")))
jcgregorio 2014/10/17 11:43:55 ave(fill(filter("config=8888"))),
tfarina 2014/10/17 21:14:23 Done.
+ )`)
+ if err != nil {
+ t.Fatalf("Failed to eval ratio() test: %s", err)
+ }
+}
+
func TestFill(t *testing.T) {
ctx := newTestContext()
ctx.Tile.Traces["t1"].(*types.PerfTrace).Values = []float64{1e100, 1e100, 2, 3, 1e100, 5}
« perf/go/parser/funcs.go ('K') | « perf/go/parser/parser.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698