diff --git a/bench/client.go b/bench/client.go index 0f975ac9c..805e287eb 100644 --- a/bench/client.go +++ b/bench/client.go @@ -2,8 +2,9 @@ package bench import ( "fmt" - "github.com/pilosa/pilosa" + "context" + "errors" ) func firstHostClient(hosts []string) (*pilosa.Client, error) { @@ -56,4 +57,14 @@ func (h *HasClient) Init(hosts []string, agentNum int) error { } } +func (h *HasClient) ExecuteQuery(contentType, db, query string, ctx context.Context) (interface{}, error) { + if contentType == "protobuf" { + return h.client.ExecuteQuery(ctx, db, query, true) + } else if contentType == "pql" { + return h.client.ExecutePQL(ctx, db, query) + } else { + return nil, errors.New("unsupport content type") + } +} + diff --git a/bench/randquery.go b/bench/randquery.go index e2e8aca03..936a6ca07 100644 --- a/bench/randquery.go +++ b/bench/randquery.go @@ -7,7 +7,6 @@ import ( "io/ioutil" "strings" "time" - "errors" ) // RandomQuery queries randomly and deterministically based on a seed. @@ -119,12 +118,3 @@ func (b *RandomQuery) Run(ctx context.Context) map[string]interface{} { return results } -func (b *RandomQuery) ExecuteQuery(contentType, db, query string, ctx context.Context, ) (interface{}, error) { - if contentType == "protobuf" { - return b.client.ExecuteQuery(ctx, db, query, true) - } else if contentType == "pql" { - return b.client.ExecutePQL(ctx, db, query) - } else { - return nil, errors.New("unsupport content type") - } -}