Skip to content

Commit

Permalink
ci: adjust benchmark units
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
  • Loading branch information
magik6k committed May 28, 2018
1 parent ede1150 commit aa169a7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/dependencies/gobench-to-json/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func mainErr() error {
results = append(results, Result{
Name: "time/op",
Description: "time per operation",
Unit: "ns",
DblValue: bench.NsPerOp,
Unit: "ms",
DblValue: bench.NsPerOp / 1e6,
})
}

Expand All @@ -90,16 +90,16 @@ func mainErr() error {
Name: "allocs/op",
Description: "number of allocations per operation",
Unit: "",
DblValue: float64(bench.AllocsPerOp), //TODO: figure out a better way
DblValue: float64(bench.AllocsPerOp),
})
}

if bench.Measured&parse.AllocedBytesPerOp != 0 {
results = append(results, Result{
Name: "alloc B/op",
Name: "alloc MB/op",
Description: "bytes allocated per operation",
Unit: "B",
DblValue: float64(bench.AllocedBytesPerOp), //TODO: figure out a better way
Unit: "MB",
DblValue: float64(bench.AllocedBytesPerOp) / (1 << 20),
})
}

Expand Down

0 comments on commit aa169a7

Please sign in to comment.