mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-06 00:25:55 +00:00
add timing info to benchmark results
This commit is contained in:
parent
e6b31db90d
commit
c24c60fdba
1 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue