mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
fix issues with import benchmark output
not all metadata was jsonified and it was timing itself
This commit is contained in:
parent
9a24b9b0e9
commit
b41fdae55f
2 changed files with 10 additions and 14 deletions
|
|
@ -7,7 +7,6 @@ import (
|
|||
"io"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"sort"
|
||||
|
||||
|
|
@ -135,9 +134,8 @@ func (b *Import) Init(hosts []string, agentNum int) error {
|
|||
b.MinBitsPerMap, b.MaxBitsPerMap, b.Seed+int64(agentNum), b.RandomBitmapOrder)
|
||||
b.numbits = num
|
||||
// set b.Paths
|
||||
f.Close()
|
||||
b.Paths = []string{f.Name()}
|
||||
return nil
|
||||
return f.Close()
|
||||
}
|
||||
|
||||
// Run runs the Import benchmark
|
||||
|
|
@ -145,13 +143,11 @@ func (b *Import) Run(ctx context.Context, 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(ctx)
|
||||
|
||||
if err != nil {
|
||||
results["error"] = err.Error()
|
||||
}
|
||||
results["time"] = time.Now().Sub(start)
|
||||
return results
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,25 +19,25 @@ import (
|
|||
// ImportCommand represents a command for bulk importing data.
|
||||
type ImportCommand struct {
|
||||
// Destination host and port.
|
||||
Host string
|
||||
Host string `json:"host"`
|
||||
|
||||
// Name of the database & frame to import into.
|
||||
Database string
|
||||
Frame string
|
||||
Database string `json:"db"`
|
||||
Frame string `json:"frame"`
|
||||
|
||||
// Filenames to import from.
|
||||
Paths []string
|
||||
Paths []string `json:"paths"`
|
||||
|
||||
// Size of buffer used to chunk import.
|
||||
BufferSize int
|
||||
BufferSize int `json:"buffer-size"`
|
||||
|
||||
// Reusable client.
|
||||
Client *pilosa.Client
|
||||
Client *pilosa.Client `json:"-"`
|
||||
|
||||
// Standard input/output
|
||||
Stdin io.Reader
|
||||
Stdout io.Writer
|
||||
Stderr io.Writer
|
||||
Stdin io.Reader `json:"-"`
|
||||
Stdout io.Writer `json:"-"`
|
||||
Stderr io.Writer `json:"-"`
|
||||
}
|
||||
|
||||
// NewImportCommand returns a new instance of ImportCommand.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue