mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-06 00:25:55 +00:00
make results nicer
This commit is contained in:
parent
b4bb9cf70d
commit
4c67cb30c0
4 changed files with 26 additions and 9 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"io"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"sort"
|
||||
|
||||
|
|
@ -140,12 +141,14 @@ func (b *Import) Init(hosts []string, agentNum int) error {
|
|||
// Run runs the Import benchmark
|
||||
func (b *Import) Run(agentNum int) map[string]interface{} {
|
||||
results := make(map[string]interface{})
|
||||
results["numbits"] = b.numbits
|
||||
results["db"] = b.Database
|
||||
start := time.Now()
|
||||
err := b.ImportCommand.Run(context.TODO())
|
||||
if err != nil {
|
||||
results["error"] = err.Error()
|
||||
}
|
||||
results["numbits"] = b.numbits
|
||||
results["config"] = *b
|
||||
results["time"] = time.Now().Sub(start)
|
||||
return results
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,16 +103,24 @@ func (b *SliceHeight) Run(agentNum int) map[string]interface{} {
|
|||
start := time.Now()
|
||||
|
||||
for i := 0; i > -1; i++ {
|
||||
iresults := make(map[string]interface{})
|
||||
results["iteration"+strconv.Itoa(i)] = iresults
|
||||
|
||||
genstart := time.Now()
|
||||
imp.Init(b.hosts, agentNum)
|
||||
results["import"+strconv.Itoa(i)] = imp.Run(agentNum)
|
||||
qt := time.Now()
|
||||
gendur := time.Now().Sub(genstart)
|
||||
iresults["csvgen"] = gendur
|
||||
|
||||
iresults["import"] = imp.Run(agentNum)
|
||||
|
||||
qstart := time.Now()
|
||||
q := &pql.TopN{Frame: b.Frame, N: 50}
|
||||
_, err := imp.Client.ExecuteQuery(context.TODO(), b.Database, q.String(), true)
|
||||
if err != nil {
|
||||
results["query"+strconv.Itoa(i)+"error"] = err.Error()
|
||||
iresults["query_error"] = err.Error()
|
||||
} else {
|
||||
qdur := time.Now().Sub(qt)
|
||||
results["query"+strconv.Itoa(i)] = qdur
|
||||
qdur := time.Now().Sub(qstart)
|
||||
iresults["query"] = qdur
|
||||
}
|
||||
imp.BaseBitmapID = imp.MaxBitmapID
|
||||
imp.MaxBitmapID = imp.MaxBitmapID * 10
|
||||
|
|
|
|||
|
|
@ -1223,7 +1223,13 @@ func (cmd *BagentCommand) Run(ctx context.Context) error {
|
|||
}
|
||||
|
||||
res := sbm.Run(cmd.AgentNum)
|
||||
fmt.Fprintln(cmd.Stdout, res)
|
||||
enc := json.NewEncoder(cmd.Stdout)
|
||||
enc.SetIndent("", " ")
|
||||
err = enc.Encode(res)
|
||||
if err != nil {
|
||||
fmt.Fprintln(cmd.Stderr, err)
|
||||
}
|
||||
// fmt.Fprintln(cmd.Stdout, res)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"Benchmarks": [
|
||||
{
|
||||
"Num": 1,
|
||||
"Args": ["slice-height", "-max-time", "10", "-max-bits-per-map", "100"]
|
||||
"Args": ["slice-height", "-max-time", "1", "-max-bits-per-map", "100"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue