diff --git a/bench/client.go b/bench/client.go index 805e287eb..101f62d4b 100644 --- a/bench/client.go +++ b/bench/client.go @@ -1,10 +1,10 @@ package bench import ( - "fmt" - "github.com/pilosa/pilosa" "context" "errors" + "fmt" + "github.com/pilosa/pilosa" ) func firstHostClient(hosts []string) (*pilosa.Client, error) { @@ -20,12 +20,11 @@ func roundRobinClient(hosts []string, agentNum int) (*pilosa.Client, error) { return firstHostClient(hosts[clientNum:]) } - // HasClient provides a reusable component for Benchmark implementations which // provides the Init method, a ClientType argument and a cli internal variable. type HasClient struct { client *pilosa.Client - ClientType string `json:"client-type"` + ClientType string `json:"client-type"` ContentType string `json:"content-type"` } @@ -66,5 +65,3 @@ func (h *HasClient) ExecuteQuery(contentType, db, query string, ctx context.Cont return nil, errors.New("unsupport content type") } } - - diff --git a/bench/randquery.go b/bench/randquery.go index 936a6ca07..8bdc98e74 100644 --- a/bench/randquery.go +++ b/bench/randquery.go @@ -111,10 +111,9 @@ func (b *RandomQuery) Run(ctx context.Context) map[string]interface{} { for n := 0; n < b.Iterations; n++ { call := qm.Random(b.MaxN, b.MaxDepth, b.MaxArgs, uint64(b.BaseBitmapID), uint64(b.BitmapIDRange)) start = time.Now() - b.ExecuteQuery(b.ContentType, b.DBs[n % len(b.DBs)], call.String(), ctx) + b.ExecuteQuery(b.ContentType, b.DBs[n%len(b.DBs)], call.String(), ctx) s.Add(time.Now().Sub(start)) } AddToResults(s, results) return results } - diff --git a/client.go b/client.go index 2a2266000..5c24920ff 100644 --- a/client.go +++ b/client.go @@ -198,10 +198,10 @@ func (c *Client) ExecuteQuery(ctx context.Context, db, query string, allowRedire func (c *Client) ExecutePQL(ctx context.Context, db, query string) (interface{}, error) { u := url.URL{ Scheme: "http", - Host: c.host, - Path: "/query", + Host: c.host, + Path: "/query", RawQuery: url.Values{ - "db": {db}, + "db": {db}, }.Encode(), }