m3db: fix Errorf calls (#703)

This commit is contained in:
stonelgh 2021-06-21 15:06:44 +08:00 committed by GitHub
parent f770b3cf14
commit 07961c9f21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 13 deletions

View File

@ -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)
}

View File

@ -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