@ -83,7 +83,7 @@ func (cp *ConnPools) Update(cluster []string) {
cp.M[address] = createOnePool(address, address, ct, maxConns, maxIdle)
}
for address, _ := range cp.M {
for address := range cp.M {
if _, exists := newCluster[address]; !exists {
delete(cp.M, address)
@ -178,7 +178,6 @@ func fetchDataSync(start, end int64, consolFun, endpoint, counter string, step i
stats.Counter.Set("query.data.err", 1)
dataChan <- data
return
func fetchData(start, end int64, consolFun, endpoint, counter string, step int) (*dataobj.TsdbQueryResponse, error) {
@ -22,7 +22,6 @@ func (this *ConsistentHashRing) Set(r *consistent.Consistent) {
this.Lock()
defer this.Unlock()
this.ring = r
func (this *ConsistentHashRing) GetRing() *consistent.Consistent {
@ -46,7 +46,7 @@ var (
)
func NewClusterNode(addrs []string) *backend.ClusterNode {
return &backend.ClusterNode{addrs}
return &backend.ClusterNode{Addrs: addrs}
// map["node"]="host1,host2" --> map["node"]=["host1", "host2"]
@ -73,7 +73,7 @@ func getStrategy() {
//var metric string
if len(stra.Exprs) < 1 {
logger.Warning("stra:%v exprs illegal", stra)
logger.Warningf("stra:%v exprs illegal", stra)
continue
if stra.Exprs[0].Func == "nodata" {
@ -52,5 +52,4 @@ func PushData(c *gin.Context) {
render.Data(c, "ok", nil)
@ -76,5 +76,4 @@ func push(items []*dataobj.MetricValue) {
defer resp.Body.Close()