From 07961c9f218ef76aac74d459662aeb02ed9538a0 Mon Sep 17 00:00:00 2001 From: stonelgh Date: Mon, 21 Jun 2021 15:06:44 +0800 Subject: [PATCH] m3db: fix Errorf calls (#703) --- src/modules/server/backend/m3db/benchmark/main.go | 7 +------ src/modules/server/backend/m3db/m3db.go | 14 +++++++------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/modules/server/backend/m3db/benchmark/main.go b/src/modules/server/backend/m3db/benchmark/main.go index 2e278f14..bff3c4f6 100644 --- a/src/modules/server/backend/m3db/benchmark/main.go +++ b/src/modules/server/backend/m3db/benchmark/main.go @@ -72,12 +72,7 @@ func main() { items := getTransferItems(endpoint, metric) //log.Println(items[0]) start := time.Now().UnixNano() - err := cli.Push(items) - if err != nil { - fmt.Println("err:", err) - } else { - //fmt.Println("resp:", resp) - } + cli.Push2Queue(items) log.Println((time.Now().UnixNano() - start) / 1000000) }(endpoint, metric) } diff --git a/src/modules/server/backend/m3db/m3db.go b/src/modules/server/backend/m3db/m3db.go index 06f4ba68..6408e2a4 100644 --- a/src/modules/server/backend/m3db/m3db.go +++ b/src/modules/server/backend/m3db/m3db.go @@ -145,7 +145,7 @@ func (p *Client) QueryData(inputs []dataobj.QueryData) []*dataobj.TsdbQueryRespo query, opts := p.config.queryDataOptions(inputs) ret, err := fetchTagged(session, p.namespaceID, query, opts) if err != nil { - logger.Errorf("unable to query data: ", err) + logger.Errorf("unable to query data: %v", err) return nil } @@ -198,7 +198,7 @@ func (p *Client) QueryMetrics(input dataobj.EndpointsRecv) *dataobj.MetricResp { tags, err := completeTags(session, p.namespaceID, query, opts) if err != nil { - logger.Errorf("unable completeTags: ", err) + logger.Errorf("unable completeTags: %v", err) return nil } return tagsMr(tags) @@ -222,7 +222,7 @@ func (p *Client) QueryTagPairs(input dataobj.EndpointMetricRecv) []dataobj.Index tags, err := completeTags(session, p.namespaceID, query, opts) if err != nil { - logger.Errorf("unable completeTags: ", err) + logger.Errorf("unable completeTags: %v", err) return nil } @@ -254,7 +254,7 @@ func (p *Client) queryIndexByClude(session client.Session, input dataobj.CludeRe iter, _, err := session.FetchTaggedIDs(p.namespaceID, query, opts) if err != nil { - logger.Errorf("unable FetchTaggedIDs: ", err) + logger.Errorf("unable FetchTaggedIDs: %v", err) return nil } @@ -276,7 +276,7 @@ func (p *Client) queryIndexByClude(session client.Session, input dataobj.CludeRe } if err := iter.Err(); err != nil { - logger.Errorf("FetchTaggedIDs iter:", err) + logger.Errorf("FetchTaggedIDs iter: %v", err) return nil } @@ -331,7 +331,7 @@ func (p *Client) queryIndexByFullTags(session client.Session, input dataobj.Inde iter, _, err := session.FetchTaggedIDs(p.namespaceID, query, opts) if err != nil { - logger.Errorf("unable FetchTaggedIDs: ", err) + logger.Errorf("unable FetchTaggedIDs: %v", err) return } @@ -350,7 +350,7 @@ func (p *Client) queryIndexByFullTags(session client.Session, input dataobj.Inde ret.Tags = append(ret.Tags, k) } if err := iter.Err(); err != nil { - logger.Errorf("FetchTaggedIDs iter:", err) + logger.Errorf("FetchTaggedIDs iter: %v", err) } return ret