summaryrefslogtreecommitdiffhomepage
path: root/test/benchmarks/tools/sysbench.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/sysbench.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/sysbench.go')
-rw-r--r--test/benchmarks/tools/sysbench.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/benchmarks/tools/sysbench.go b/test/benchmarks/tools/sysbench.go
index 6b2f75ca2..7ccacd8ff 100644
--- a/test/benchmarks/tools/sysbench.go
+++ b/test/benchmarks/tools/sysbench.go
@@ -80,7 +80,7 @@ func (s *SysbenchCPU) Report(b *testing.B, output string) {
if err != nil {
b.Fatalf("parsing CPU events from %s failed: %v", output, err)
}
- b.ReportMetric(result, "cpu_events_per_second")
+ ReportCustomMetric(b, result, "cpu_events" /*metric name*/, "events_per_second" /*unit*/)
}
var cpuEventsPerSecondRE = regexp.MustCompile(`events per second:\s*(\d*.?\d*)\n`)
@@ -144,7 +144,7 @@ func (s *SysbenchMemory) Report(b *testing.B, output string) {
if err != nil {
b.Fatalf("parsing result %s failed with err: %v", output, err)
}
- b.ReportMetric(result, "operations_per_second")
+ ReportCustomMetric(b, result, "memory_operations" /*metric name*/, "ops_per_second" /*unit*/)
}
var memoryOperationsRE = regexp.MustCompile(`Total\soperations:\s+\d*\s*\((\d*\.\d*)\sper\ssecond\)`)
@@ -198,19 +198,19 @@ func (s *SysbenchMutex) Report(b *testing.B, output string) {
if err != nil {
b.Fatalf("parsing result %s failed with err: %v", output, err)
}
- b.ReportMetric(result, "average_execution_time_secs")
+ ReportCustomMetric(b, result, "average_execution_time" /*metric name*/, "s" /*unit*/)
result, err = s.parseDeviation(output)
if err != nil {
b.Fatalf("parsing result %s failed with err: %v", output, err)
}
- b.ReportMetric(result, "stdev_execution_time_secs")
+ ReportCustomMetric(b, result, "stddev_execution_time" /*metric name*/, "s" /*unit*/)
result, err = s.parseLatency(output)
if err != nil {
b.Fatalf("parsing result %s failed with err: %v", output, err)
}
- b.ReportMetric(result/1000, "average_latency_secs")
+ ReportCustomMetric(b, result/1000, "average_latency" /*metric name*/, "s" /*unit*/)
}
var executionTimeRE = regexp.MustCompile(`execution time \(avg/stddev\):\s*(\d*.?\d*)/(\d*.?\d*)`)