提交 8895bec2 作者: Łukasz Magiera

ci: adjust benchmark units

License: MIT
Signed-off-by: 's avatarŁukasz Magiera <magik6k@gmail.com>
上级 ede11501
...@@ -194,10 +194,12 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) { ...@@ -194,10 +194,12 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) {
}, },
'benchmark': { 'benchmark': {
setupStep('linux') { run -> setupStep('linux') { run ->
timeout(time: sharness_timeout, unit: 'MINUTES') {
run 'make test/bench/bench-results.json' run 'make test/bench/bench-results.json'
benchmark altInputSchema: '', altInputSchemaLocation: '', inputLocation: 'test/bench/bench-results.json', schemaSelection: 'defaultSchema', truncateStrings: false benchmark altInputSchema: '', altInputSchemaLocation: '', inputLocation: 'test/bench/bench-results.json', schemaSelection: 'defaultSchema', truncateStrings: false
} }
}
}, },
) )
} }
......
...@@ -71,8 +71,8 @@ func mainErr() error { ...@@ -71,8 +71,8 @@ func mainErr() error {
results = append(results, Result{ results = append(results, Result{
Name: "time/op", Name: "time/op",
Description: "time per operation", Description: "time per operation",
Unit: "ns", Unit: "ms",
DblValue: bench.NsPerOp, DblValue: bench.NsPerOp / 1e6,
}) })
} }
...@@ -90,16 +90,16 @@ func mainErr() error { ...@@ -90,16 +90,16 @@ func mainErr() error {
Name: "allocs/op", Name: "allocs/op",
Description: "number of allocations per operation", Description: "number of allocations per operation",
Unit: "", Unit: "",
DblValue: float64(bench.AllocsPerOp), //TODO: figure out a better way DblValue: float64(bench.AllocsPerOp),
}) })
} }
if bench.Measured&parse.AllocedBytesPerOp != 0 { if bench.Measured&parse.AllocedBytesPerOp != 0 {
results = append(results, Result{ results = append(results, Result{
Name: "alloc B/op", Name: "alloc mem/op",
Description: "bytes allocated per operation", Description: "bytes allocated per operation",
Unit: "B", Unit: "MB",
DblValue: float64(bench.AllocedBytesPerOp), //TODO: figure out a better way DblValue: float64(bench.AllocedBytesPerOp) / (1 << 20),
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论