blob: a413a0f8157fc652ac86db2c1413a9537ea731de [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package ben defines datastructures to archive microbenchmark results.
// These are the data structures common to tools described in
package ben
// Cpu describes the CPU of the machine on which the microbenchmarks were run.
type Cpu struct {
Architecture string // Architecture of the CPU, e.g. "amd64", "386" etc.
Description string // A detailed description of the CPU, e.g., "Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz"
ClockSpeedMhz uint32 // Clock speed of the CPU in MHz
// Os describes the Operating System on which the microbenchmarks were run.
type Os struct {
Name string // Short name of the operating system: linux, darwin, android etc.
Version string // Details of the distribution/version, e.g., "Ubuntu 14.04", "Mac OS X 10.11.2 15C50" etc.
// Scenario encapsulates the conditions on the machine on which the microbenchmarks were run.
type Scenario struct {
Cpu Cpu
Os Os
Label string // Arbitrary string label assigned by the uploader.
// SourceCode represents the state of the source code used to build the
// microbenchmarks.
// Typically it would be the commit hash of a git repository or the contents of
// a manifest of a jiri ( project and not
// the complete source code itself.
type SourceCode string
// Run encapsulates the results of a single microbenchmark run.
type Run struct {
Name string // Name of the microbenchmark. <package>.Benchmark<Name> in Go.
Iterations uint64
NanoSecsPerOp float64 // Nano-seconds per iteration.
AllocsPerOp uint64 // Memory allocations per iteration.
AllocedBytesPerOp uint64 // Size of memory allocations per iteration.
MegaBytesPerSec float64 // Throughput in MB/s.
Parallelism uint32 // For Go, the GOMAXPROCS used during benchmark execution