summaryrefslogtreecommitdiffhomepage
path: root/test/benchmarks/tools/hey.go
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2020-10-09 14:26:55 -0700
committergVisor bot <gvisor-bot@google.com>2020-10-09 14:29:21 -0700
commitb576de907cb42b8df11695cc58792631f4c059ae (patch)
tree5cb8fe698911b8142a2f09faa6d7fe6cec998f69 /test/benchmarks/tools/hey.go
parent6df400dfb61e2219b1d88dd2aa6be7fbb59d3ab6 (diff)
Add parsers golang benchmarks.
Add parser and formatting for golang benchmarks for docker benchmarks. Change adds a library for printing and parsing Test parameters and metrics. Benchmarks use the library to print parameters in the Benchmark title (e.g. the name field in b.Run()), and to report CustomMetrics. Parser uses the library to parse printed data from benchmark output and put it into BigQuery structs. PiperOrigin-RevId: 336365628
Diffstat (limited to 'test/benchmarks/tools/hey.go')
-rw-r--r--test/benchmarks/tools/hey.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/benchmarks/tools/hey.go b/test/benchmarks/tools/hey.go
index b1e20e356..b8cb938fe 100644
--- a/test/benchmarks/tools/hey.go
+++ b/test/benchmarks/tools/hey.go
@@ -43,13 +43,13 @@ func (h *Hey) Report(b *testing.B, output string) {
if err != nil {
b.Fatalf("failed to parse requests per second: %v", err)
}
- b.ReportMetric(requests, "requests_per_second")
+ ReportCustomMetric(b, requests, "requests_per_second" /*metric name*/, "QPS" /*unit*/)
ave, err := h.parseAverageLatency(output)
if err != nil {
b.Fatalf("failed to parse average latency: %v", err)
}
- b.ReportMetric(ave, "average_latency_secs")
+ ReportCustomMetric(b, ave, "average_latency" /*metric name*/, "s" /*unit*/)
}
var heyReqPerSecondRE = regexp.MustCompile(`Requests/sec:\s*(\d+\.?\d+?)\s+`)