From c24c60fdbae9e31d2d3b1df85c9c80843fd6d323 Mon Sep 17 00:00:00 2001 From: jaffee Date: Fri, 11 Nov 2016 10:01:05 -0600 Subject: [PATCH] add timing info to benchmark results --- bench/bench.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bench/bench.go b/bench/bench.go index f8be2acf3..97a3b048c 100644 --- a/bench/bench.go +++ b/bench/bench.go @@ -9,6 +9,8 @@ import ( "flag" "io/ioutil" + "time" + "github.com/umbel/pilosa" ) @@ -201,10 +203,15 @@ func (sb *serialBenchmark) Init(hosts []string) error { // and the values are the results of each benchmark's Run method. func (sb *serialBenchmark) Run(agentNum int) map[string]interface{} { results := make(map[string]interface{}, len(sb.benchmarkers)) + runtimes := make(map[string]time.Duration) for i, b := range sb.benchmarkers { + start := time.Now() ret := b.Run(agentNum) + end := time.Now() results[strconv.Itoa(i)] = ret + runtimes[strconv.Itoa(i)] = end.Sub(start) } + results["runtimes"] = runtimes return results }